How can I run a windows batch file but hide the command window?

前端 未结 10 1849
情深已故
情深已故 2020-11-30 01:40

How can I run a windows batch file but hiding the command window? I dont want cmd.exe to be visible on screen when the file is being executed. Is this possible?

10条回答
  •  庸人自扰
    2020-11-30 02:38

    To self-hide already running script you'll need getCmdPid.bat and windowoMode.bat

    @echo off
    
    echo self minimizing
    call getCmdPid.bat
    call windowMode.bat -pid %errorlevel% -mode hidden
    
    echo --other commands--
    pause
    

    Here I've compiled all ways that I know to start a hidden process with batch without external tools.With a ready to use scripts (some of them rich on options) , and all of them form command line.Where is possible also the PID is returned .Used tools are IEXPRESS,SCHTASKS,WScript.Shell,Win32_Process and JScript.Net - but all of them wrapped in a .bat files.

提交回复
热议问题