I’ve spent several hours searching and trying different things, but I can’t get this script to run. It is called by a web page:
[php]
error_reporting(E_ALL);
ini_set(‘display_errors’, ‘1’);
if($_POST['store_list'] && $_POST['start_date'] && $_POST['end_date']){
$cmd = 'wscript.exe <path_to_script>/my_script.vbs /store_list:"' . urldecode($_POST['store_list']) . '" /start_date:"' . urldecode($_POST['start_date']) . '" /end_date:"' . urldecode($_POST['end_date']) . '"';
$ws = new COM('WScript.Shell');
$ws->Run('cmd /c ' . $cmd, 0, false);
}
[/php]
I tried:
[ul][li]with & without wscript.exe, cscript.exe, cmd /c, cmd.exe /c, cmd.exe /c /k[/li]
[li]referencing the path to the .vbs file with /, , and \[/li]
[li]exec()[/li]
[li]shell_exec()[/li][/ul]
When I run the script from the command line it works perfectly.
The .vbs file is in a path outside the wwwroot folder. I set the permissions on the .vbs file & the folder it’s in to allow read & execute for the Internet Guest Account.
The web page seems to indicate the script is being executed but nothing happens. Process Explorer only shows the error: “[Error opening process]” but no other information.
Please help.