BirdieUK Posted November 24, 2010 Share Posted November 24, 2010 Hi, I have a windows xp home edition computer running xampp and for some reason, the following programs will not work when called upon. $command = "iexplore.exe www.google.com"; system($command); $command2 = "C:\\xampp\\htdocs\\spotifyControl\\playpause.ahk"; system($command2); Both commands, when in command prompt, work perfectly... any ideas?? Thanks. Quote Link to comment Share on other sites More sharing options...
jim_keller Posted November 24, 2010 Share Posted November 24, 2010 I've run into trouble with exec() on Windows before due to not having my quotes set up correctly. for some reason when using exec() on windows with a path that has spaces in it, not only do you need to enclose the path itself in double quotes, but the entire exec'd command needs to be enclosed in double quotes as well. Try your call as: $command = "\"iexplore.exe www.google.com\""; or $command = "\"iexplore.exe\" \"www.google.com\""; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.