ptolomea Posted September 16, 2007 Share Posted September 16, 2007 First off I have done a search for this and there were actually 3 posts dealing with something along the same lines as me. But there were no responses, the posters did not list enough of their code to see if they had something different that I have yet to try. Here goes. I am trying to run a .vbs script from php. I do not need the output of this script as the sole purpose of the website I am building is to run this script for a file. The vbs script works flawlessly if I run cscript maintest.vbs from a command prompt here is the code for the .php <?PHP $runCommand = "C:\\ISOStuff\\mount.vbs"; $wshshell = new COM("WScript.Shell"); $wshshell->Run($runCommand); ?> now I have tryed all of the items below with and with out cscript in front. shell_exec() with the vbs file and a baseline test for what the vbs file is sposed to do.(Open a file with test permamiters that the vbs script is able to get) system() only the vbs file. this one i get a responce on the page but its just the first line of the cscript. exec() just to help here is the vbs file to set wshshell = wscript.createobject("wscript.shell") Set objEnv = WshShell.Environment("User") iso = objEnv("mountediso") wshshell.run "C:\isostuff\daemon.exe -unmount 0" wshshell.run "C:\isostuff\daemon.exe -mount 0, " & iso in the enviorment user section i have created a variable called mountediso and it holds C:\random.iso and random.iso is a small file i created that has a window pop up on autorun so i can quickly tell if the procedure worked. I am using wamp5 server (package of mysql4.1, apache2.2 and php5.2.2(CLI), and just because I saw another post on here about it, i have enabled the apache servers to allow interaction with desktop in services then rebooted Any help is apreciated Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.