How to start a batch file minimized with task scheduler in Windows 8? - %comspec% method not working anymore after Windows 7

前端 未结 6 1532
再見小時候
再見小時候 2021-02-01 14:45

After Windows XP, I always use the trick below to start batch files minimized with Windows Task Manager.

From http://www.pcreview.co.uk/forums/running-bat-files-minimize

6条回答
  •  有刺的猬
    2021-02-01 15:35

    I didn't like seeing the command window pop up and then disappear so here is another solution from https://ss64.com/vb/run.html ...

    First create invisible.vbs with this single line of text:

    CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
    

    Next and finally, launch your cmd or batch file via:

    %SystemRoot%\system32\wscript.exe "invisible.vbs" "myscript.cmd" //nologo
    

    Ta da! Scripting of this sort has been built into Windows for a long time. If you're curious, do a web search for "WSH" (windows scripting host). You can even write such scripts in dialect of JavaScript called JScript.

提交回复
热议问题