Suppress command line output

前端 未结 4 1234
挽巷
挽巷 2020-11-30 19:05

I have a simple batch file like this:

echo off

taskkill /im \"test.exe\" /f > nul

pause

If \"test.exe\" is not running, I get this message:



        
4条回答
  •  天涯浪人
    2020-11-30 19:39

    You can do this instead too:

    tasklist | find /I "test.exe" > nul && taskkill /f /im test.exe > nul
    

提交回复
热议问题