Windows 工作排程器不會殺死子行程

Windows 工作排程器不會殺死子行程

我的任務排程器任務有一個操作:Start application-->D:\test.bat 批次test.bat產生一個子程序(例如):

notepad.exe

當我手動啟動此任務並結束此任務時,它不會停止 notepad.exe。如何在不意外關閉其他 notepad.exe 進程的情況下殺死所有子進程(例如 notepad.exe)?

編輯:
最終目標是從週五上午 7 點到下午 15 點運行 notepad.exe。
當我使用 powershell 而不是批次時,它可以工作。

我正在執行 Windows Server 2012 R2(版本 6.3.9600)

相關內容