让电脑重启指定次数的bat
原理 把重启bat复制到开机启动项里,每次开机回来运行
@echo off
title Restart
color 0A
echo ====================================
echo RE:Pelase Runing On The User\Desktop
echo ====================================
cd "%Userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
if exist 2.txt goto start
if exist log.log del log.log
if exist restart.bat del restart.bat
cd %Userprofile%\Desktop
copy restart.bat "%Userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
:start
cd %Userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
if not exist 1.txt goto set
if exist 2.txt for /F %%i in (2.txt) do set /a b=%%i
set /a b+=1
echo %b% >2.txt
for /F %%i in (1.txt) do set /a c=%%i
if %b% gtr %c% goto end
::restart
echo %b% >>log.log
echo %date% %time% >>log.log
cd c:\windows\system32
shutdown -r -t 0
pause >nul
:end
del 1.txt
del 2.txt
del restart.bat
copy log.bat "%Userprofile%\Disktop"
:set
echo ===================================
echo [pelase input the times of Restart]
echo ===================================
set /p a=
echo %a% >1.txt
goto start

浙公网安备 33010602011771号