The cloud-dwelling community here is simple to organize the common method, convenient for everyone to use. It's all through VBScript code.
The way to hide the cmd window while running a bat can edit a VBS script in which the batch program runs with a hidden window.
Copy Code code as follows:
Set ws = CreateObject ("Wscript.Shell")
Ws.run "cmd/c Batch program name", Vbhide
Copy the code above to Notepad, save it as "Runbat.vbs" or another name (the extension must be. vbs), and then click Run the generated script Runbat.vbs to hide the run of the specified batch program.
This VBS script can also be invoked directly in the bat environment to hide the bat itself.
Summary of their own, do a few examples, interested to go to the test Ah!
Copy Code code 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
Hide Run Hide_run.vbs
In fact, nothing original, but the feeling is also practical, encapsulated, can be used as a command tool. But with caution ~
Hide_run.vbs [Command1] ...
Copy Code code as follows:
On Error Resume Next
Set objargs=wscript.arguments
For I=0 to Objargs.count-1
Strargs=objargs (I)
If strargs<> "" Then Hiderun (Strargs)
Next
function Hiderun (h)
Set Owsl=wscript.createobject ("Wscript.Shell")
Rtn=owsl.run (H,0,false)
End Function