Remote Execution of Windows Desktop Applications Using Apache and PHP

Install Apache.

Install PHP.

Install PsTools.

Use PHP’s exec() function to launch a windows program. The following is an example:

<?php
exec(’C:\PsTools\psexec.exe -d -accepteula “C:\Program Files\VideoLAN\VLC\vlc.exe” -f http://movies.apple.com/movies/lionsgate/the_spirit/the_spirit_h.320.mov 2>&1′,$output);
var_dump($output);
?>

Take note of the flags. “-d” means don’t wait for the child process to terminate before continuing PHP execution. “-accepteula” is required in order for PsTools to run properly. VLC note: the “-f” flag tells VLC to play the movie fullscreen.

Start Apache, but don’t run it as a service. Instead run Apache from the desktop as the local user.
From a remote computer, point a web browser at the PHP page that implements the exec() function.

0 Responses to “Remote Execution of Windows Desktop Applications Using Apache and PHP”


  1. No Comments

Leave a Reply