Every batch file I write opens a Cmd window and leaves it open until the program is completed. What is the command string to include in the .bat file to either not open the CMD window or open it and immediately hide it? I must stay within the confines of MSW7 Pro's built in programming. Right now, I'm just playing with the msg command to get this figured out. For success, only the message window itself should appear on screen.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If you are starting a batch file then use:
cmd /c "Your Command and Parameters"
If you want the batch file to close the cmd window, then put exit
at the end of the batch file
@echo My Batch File
exit
As a further though, the start
command might help you. It can be set to minimize the window.
START /MIN MyBatch.Bat
回答2:
You can do it by creating a vb script.
hideCMD.vbs
CreateObject("Wscript.Shell").Run "foo.bat", 0, True
This will run your batch file with command prompt window hidden.