- 使用vbs實現(推薦)
CreateObject("WScript.Shell").Run "D:\syncthing\syncthing.exe",0
或者批量運行:
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c start winrar.exe",vbhide
ws.run "cmd /c start msimn.exe",vbhide
ws.run "cmd /c start iexplore.exe",vbhide
複製保存成vbs文件即可。
2. 使用cmd實現(會有一閃而過的黑窗)
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
::以下爲正常批處理命令,不可含有pause set/p等交互命令
複製保存爲bat文件即可。