Cod3r Posted June 27, 2011 Share Posted June 27, 2011 Hello, this is my first post here. Hope you'll be able to help me and vice-versa, seems like a nice community from what I read so far. I am currently facing an issue, hopefully someone will know what I'm doing wrong. I have developed a system in PHP that sends command line arguments to a Windows application on the server. I have first worked on my local installation, and it worked well using PsExec: exec("psexec -d C:\folder\application.exe arg1 arg2 arg3"); So I thought this would also work on my Windows server. Well, it doesn't. So I search why I wouldn't work. I have allowed the Apache service to interact with the desktop. I have also tried this: exec(" C:\pstools\psexec.exe -d C:\folder\application.exe arg1 arg2 arg3"); It's kinda hard because I don't get any output whatsoever from exec, I really don't know why it's not launching the application. Also, I am a total Windows noob, it's my first Windows server. This could well be linked Thank you for your help. Regards. Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted June 28, 2011 Share Posted June 28, 2011 Are you using cron jobs or something? Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/#findComment-1235723 Share on other sites More sharing options...
Cod3r Posted June 28, 2011 Author Share Posted June 28, 2011 No I don't... Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/#findComment-1235724 Share on other sites More sharing options...
Cod3r Posted June 28, 2011 Author Share Posted June 28, 2011 So, no one has an idea on how I can launch a desktop application from PHP on a Windows server?! Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/#findComment-1235849 Share on other sites More sharing options...
ZulfadlyAshBurn Posted June 28, 2011 Share Posted June 28, 2011 i never tried it before. if you know abt it, tell me Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/#findComment-1235853 Share on other sites More sharing options...
mikosiko Posted June 28, 2011 Share Posted June 28, 2011 try this : exec("C:\\pstools\\psexec.exe -d C:\\folder\\application.exe arg1 arg2 arg3"); // Note the double \ usage other option: $thecmd = `C:\\pstools\\psexec.exe -d C:\\folder\\application.exe arg1 arg2 arg3`; // Note the backticks usage (shell_exec equivalent) echo "<pre>$thecmd</pre>"; Link to comment https://forums.phpfreaks.com/topic/240569-launch-application-on-windows-server/#findComment-1235867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.