7

I have a bat file contains the following commands.

start /WAIT /d "C:\Program Files\7-Zip" 7z.exe u -ms=off "D:\7zbackup\android.7z" "C:\xampp\htdocs\android"
start /WAIT /d "C:\Program Files\7-Zip" 7z.exe u -ms=off "D:\7zbackup\aspnet.7z" "C:\xampp\htdocs\aspnet"
start /WAIT /d "C:\Program Files\7-Zip" 7z.exe u -ms=off "D:\7zbackup\bitbucket.7z" "C:\xampp\htdocs\bitbucket"
start /WAIT /d "C:\Program Files\7-Zip" 7z.exe u -ms=off "D:\7zbackup\bitbucket_sourcetree.7z" "C:\xampp\htdocs\bitbucket_sourcetree"

It will prompt a cmd window to the front for each line of the command. How do I make it not prompt and run minimized or run in the background?

2 Answers 2

7

Use start with parameter '/B':

start /B /WAIT /d "C:\Program Files\7-Zip" 7z.exe u -ms=off "D:\7zbackup\android.7z" "C:\xampp\htdocs\android"

/b: Starts an application without opening a new command prompt window. Ctrl + C handling is ignored unless the application enables Ctrl + C processing. Use Ctrl + Break to interrupt the application. (Start (TechNet).)

0
13

It is your use of start which causes the new window to appear.

7z is 7-Zip's command-line program, so it can be called directly:

"C:\Program Files\7-Zip\7z.exe" u ...

This way everything stays within the original window.

2
  • not working, can't detect the command line option
    – hkguie
    Sep 1, 2017 at 2:21
  • @hkguie - I don't understand your response "can't detect the command line option": you're passing exactly the same parameter string as you used with the start command, so command line options should not be a problem, unless you mis-typed.
    – AFH
    Sep 1, 2017 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .