System

What rediculously simple thing am i missing here?


<?php
ini_set('display_errors',1);
error_reporting(E_ALL);

system("\\"C:\\\\Program Files (x86)\\\\AVS4YOU\\\\AVSVideoRecorder\\\\AVSVideoRecorder.exe\\"",$quack);
echo $quack;
?>

$quack echos out as 1, but the program doesnt launch.

I think you want to use shell_exec() instead of system(). Although I may be wrong. I haven’t used PHP in a Windows environment before.

$quack = shell_exec("C:\\Program Files (x86)\\AVS4YOU\\AVSVideoRecorder\\AVSVideoRecorder.exe");

Are you expecting a GUI to launch? This post at SO suggests its not possible unfortunately… It just opens it in the background, and waits for it to close.

If the system call wasnt allowed, why would the function return 1, and not just crash or throw an error? Not entirely sure what i’m looking for in the info to confirm the system call… though looking at it, it’s running in Apache 2.0 Handler mode…grumble

How about


<?php
ini_set('display_errors',1);
error_reporting(E_ALL);

system(escapeshellcmd("C:\\Program Files (x86)\\AVS4YOU\\AVSVideoRecorder\\AVSVideoRecorder.exe"), $quack);
echo $quack;
?>

?

Same result. :confused:

Is the system call even allowed? Check in phpinfo.

Does it need other args to be passed to it, like a filename or some kind of switch?