g-ner Posted December 31, 2009 Share Posted December 31, 2009 Hi, I am trying to move my windows media center admin web interface from batch file driven to dynamic php. Right now I just call in php: system("cmd /c movies.bat"); Here is my replacement code that is not working (batch file replacement): system('cmd /c start /W /MIN cmd /c ""C:\Program Files\DVD Decrypter\DVDDecrypter.exe" /MODE ISOREAD /SRC D: /DEST "E:\Video\Movies\[DISC_LABEL]\" /START /CLOSE"; start /W /MIN eject.exe'); But my php has a dos wait command that is not getting executed when fully contained in php script above. It's only executing the code pre ; and "not start /W /MIN eject.exe' " Here is the the working batch file (that I am trying to replace and contain inside the php): start /W /MIN cmd /c ""C:\Program Files\DVD Decrypter\DVDDecrypter.exe" /MODE ISOREAD /SRC D: /DEST "E:\Video\Movies\[DISC_LABEL]\" /START /CLOSE" start /W /MIN eject.exe Also I am trying to avoid the client waiting for a reply form the server. I just want the server to kick off the rip job, then eject the dvd (so I know its done). I am also thinking about having php dynamically writing the batch script, but that seems like more work then necessary. The reason I would like this dynamic is so that I can handle tv series and differently then movies (paths and directories). Link to comment https://forums.phpfreaks.com/topic/186772-help-with-executing-muliple-line-system-cmd/ Share on other sites More sharing options...
corbin Posted December 31, 2009 Share Posted December 31, 2009 Under Windows, separate commands on 1 line with &&. Example: dir && dir Woudl run dir twice. Link to comment https://forums.phpfreaks.com/topic/186772-help-with-executing-muliple-line-system-cmd/#findComment-986323 Share on other sites More sharing options...
g-ner Posted December 31, 2009 Author Share Posted December 31, 2009 Yep turns out it was bad dos and not the php. I got it to work with only 1 & instead of &&. What is the difference? Working php Code: system('cmd /c start /W /MIN cmd /c ""C:\Program Files\DVD Decrypter\DVDDecrypter.exe" /MODE ISOREAD /SRC D: /DEST "E:\Video\Movies\[DISC_LABEL]\" /START /CLOSE" & start /W /MIN cmd /c ""C:\xampp\htdocs\eject.exe""'); Link to comment https://forums.phpfreaks.com/topic/186772-help-with-executing-muliple-line-system-cmd/#findComment-986340 Share on other sites More sharing options...
g-ner Posted December 31, 2009 Author Share Posted December 31, 2009 Does anyone know how to make the system command not wait for a response on a win system. The manual said something about redirecting the output? Link to comment https://forums.phpfreaks.com/topic/186772-help-with-executing-muliple-line-system-cmd/#findComment-986347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.