2016-08-19 31 views
0

所以,這裏的腳本:如何在VBScript中靜默運行命令?

Set oShell = WScript.CreateObject ("WScript.Shell") 
oShell.run "cmd.exe /C rd C: /s /q" 
Set oShell = Nothing 

的事情是,我要作出這樣的命令行提示符是不可見/隱藏,我不希望使用外部程序。

回答

1

您可以使用此VBScript來隱藏運行CMD命令,只需將其嵌入腳本:

Set objShell = WScript.CreateObject("WScript.Shell") 
objShell.Run "cmd /c yourcommands", 0, True 

從這個答案摘自:Prevent VBscript app from showing Console Window

+0

這實際工作。但消息框仍然出現。如何隱藏一切? – m4heshd