MetalSmith Posted February 20, 2009 Share Posted February 20, 2009 I am stumped on why when I run a script from DOS using php script.php this will work fine: <?php echo exec("c:\putty.exe -ssh [email protected] -pw password -m reload.sh"); ?> But when I run the same script changing the folder where putty is it won't run: <?php echo exec("c:\program files\putty.exe -ssh [email protected] -pw password -m reload.sh"); ?> What could I be missing? Link to comment https://forums.phpfreaks.com/topic/146049-need-help-with-exec/ Share on other sites More sharing options...
killah Posted February 20, 2009 Share Posted February 20, 2009 should'nt your folder be Program Files ? Link to comment https://forums.phpfreaks.com/topic/146049-need-help-with-exec/#findComment-766718 Share on other sites More sharing options...
corbin Posted February 20, 2009 Share Posted February 20, 2009 Paths to executables must be quoted if they have spaces. echo exec("\"c:\program files\putty.exe\" -ssh [email protected] -pw password -m reload.sh"); Or, more straightforward: echo exec('"c:\program files\putty.exe" -ssh [email protected] -pw password -m reload.sh'); Link to comment https://forums.phpfreaks.com/topic/146049-need-help-with-exec/#findComment-766719 Share on other sites More sharing options...
MetalSmith Posted February 20, 2009 Author Share Posted February 20, 2009 It's case sensitive? Link to comment https://forums.phpfreaks.com/topic/146049-need-help-with-exec/#findComment-766721 Share on other sites More sharing options...
MetalSmith Posted February 20, 2009 Author Share Posted February 20, 2009 Thanks Corbin!! Link to comment https://forums.phpfreaks.com/topic/146049-need-help-with-exec/#findComment-766723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.