I have this line of code:
shell_exec("\"C:\Program Files (x86)\WinSCP\winSCP.exe\" /console /script=c:\\wamp\\www\\client\\transfer_script.txt");
The command works in command prompt, and I am sure that it is escaped correctly. Also, I have php safe mode set to off, and no disabled_functions in my php.ini.
I can’t get the command to run when I call the php script. Any ideas?
Edit:
Now I’m definitely sure it is escaped properly.
I don’t think it’s escaped properly. Consider:
That doesn’t look right. Try double-escaping the backslashes outside of the quotes (where pointing to script source):
Better.
UPDATE
If that still doesn’t work I’d try quadruple-escaping with
\\\\, just in case Windows needs the double-backslashes. Consider also checking for error codes.