CopyCode The Code is as follows: @ echo off
: Code by LZ-myst QQ: 8450919 blog: http://hi.baidu.com/lzmyst http://www.clxp.net.cn
If "% 1" NEQ "1 "(
> "% Temp % \ TMP. vbs" Echo set wshshell = wscript. Createobject ^ (^ "wscript. Shell ^" ^)
> "% Temp % \ TMP. vbs "Echo wshshell. run CHR ^ (34 ^) ^ & % 0 ^ & CHR ^ (34 ^) ^ & ^ "1 ^", 0
Start/D "% Temp %" tmp. vbs
Exit
)
: From here on, it's your batch processing code. The dos black box will flash and go to the background to run it.
Pause
: You will see a hidden cmd process in the task manager.
How to hide the CMD window when running bat
You can edit a vbs script by hiding the CMD window when running BAT to hide the window for batch processing.Program.Copy codeThe Code is as follows: Set Ws = Createobject ("wscript. Shell ")
WS. Run "CMD/C batch processing program name", vbhide
Copy the above Code to notepad and save it as "runbat. vbs "or other names (the extension must be. vbs), and then click Run the generated script runbat. vbs to hide and run the specified batch processing program.
This vbs script can also be called directly in the bat environment to hide the bat itself.
I would like to summarize some examples and try it out if you are interested!Copy codeThe Code is as follows: Set Ws = Createobject ("wscript. Shell ")
Wscript. Sleep 1200 ws. Run "CMD/C start winrar.exe", vbhide
Wscript. Sleep 2200 ws. Run "CMD/C start msimn.exe", vbhide
Wscript. Sleep 1200 ws. Run "CMD/C start iexplore.exe", vbhide