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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.