@echo off
for /l %%i in (1,1,5)  do ( 
    tasklist /fi "imagename eq sysprep.exe" | find /i "sysprep.exe" 
    if not errorlevel 1 ( 
        taskkill /F /IM "sysprep.exe" 
        if errorlevel 0 goto :NEXT
    )
    echo Retry to terminate sysprep process... %%i 
    if %%i EQU 5 goto :SHUTDOWN
    ping 1.0.0.0 -n 1 -w 6000 > nul 
)

:NEXT
echo 1

echo 2

echo 3

:SHUTDOWN
echo shutdown

 

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2021-05-03
  • 2021-12-25
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
  • 2021-09-09
  • 2022-01-15
  • 2022-02-08
相关资源
相似解决方案