Gra*_*ath 7 windows cmd batch-file
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.
您可以通过创建一个 vb 脚本来实现。
隐藏命令文件
CreateObject("Wscript.Shell").Run "foo.bat", 0, True
Run Code Online (Sandbox Code Playgroud)
这将在隐藏命令提示符窗口的情况下运行您的批处理文件。
如果您要启动批处理文件,请使用:
cmd /c "Your Command and Parameters"
Run Code Online (Sandbox Code Playgroud)
如果你想让批处理文件关闭cmd窗口,那么放在exit
批处理文件的末尾
@echo My Batch File
exit
Run Code Online (Sandbox Code Playgroud)
更进一步,该start
命令可能会对您有所帮助。可以将其设置为最小化窗口。
START /MIN MyBatch.Bat
Run Code Online (Sandbox Code Playgroud)