@echo off
setlocal enabledelayedexpansion
set CountF=C:\test\RebootN.txt
if not exist "%CountF%" (
>"%CountF%" echo 101
shutdown -r -f -t 0
) else (
set /p count=<"%CountF%"
if "%count%" lss "200" (
set /a count+=1
>"%CountF%" echo !count!
shutdown -r -f -t 0
) else (
echo 進入後面的動作
)
)
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v test /t REG_SZ /d "%~f0" /f