How to stop process from .BAT file?

后端 未结 6 670
野趣味
野趣味 2020-12-14 15:25

So I have process I started from one bat file. How to stop it from another?

6条回答
  •  孤街浪徒
    2020-12-14 16:07

    As TASKKILL might be unavailable on some Home/basic editions of windows here some alternatives:

    TSKILL processName
    

    or

    TSKILL PID
    

    Have on mind that processName should not have the .exe suffix and is limited to 18 characters.

    Another option is WMIC :

    wmic Path win32_process Where "Caption Like 'MyProcess.exe'" Call Terminate
    

    wmic offer even more flexibility than taskkill .With wmic Path win32_process get you can see the available fileds you can filter.

提交回复
热议问题