我正在撰写一幅小刀切的申请。 我拿到这张id子,然后试图做以下工作:
taskkill /t /pid !pid!
If I am running the command from the console (typing it by hand) everything works fine. I see the shutdown routine being executed in the java console and afterwards the java console is gone. I sometimes see the windows "process not responding. kill now or wait" dialog after a few seconds but the dialog is automatically closed when the java program stops.
如果一经同一指挥处执行一个批次档案,我就立即看到“没有答复的程序”。 我看到了黄色产出:“工艺已成功关闭”,但 j鱼仍然开放。 它甚至没有启动关闭顺序。
编辑:完整打字
@echo off
setlocal enabledelayedexpansion
if exist .lock (
set /p pid=< lock
taskkill /t /pid !pid!
)