View Single Post
Old 01-30-2013, 09:53 PM   PM User | #6
Raphael
New Coder

 
Join Date: Mar 2009
Posts: 70
Thanks: 3
Thanked 3 Times in 3 Posts
Raphael is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
An alternate suggestion:

Execute a ".bat" file and have that ".bat" file contain the command.

If need be, PHP can create the ".bat" file.

The advantage is that you can actually then LOOK at the ".bat" file to see if it contains what you expect it to contain *and* you can execute it by hand to make sure it works when you do so.

I have even done this when invoking ".vbs" from other ".vbs" code. Just so I can be sure that I'm issuing the command I think I'm issuing.
That is a great idea. I tried it and it creates the .bat file with no problems. I can run the .bat file from the command line and it works. However, the shell_exec(<filename.bat>) still won't work. I get this error:

CScript Error: Loading your settings failed. (Access is denied. )
Raphael is offline   Reply With Quote