Jump to content

Help with executing muliple line system cmd


g-ner

Recommended Posts

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).

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""');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.