admin管理员组文章数量:1625838
这是无聊时候看了下批处理文档写的,基本上实现了重启电脑的指定次数。缺点是只能放在桌面上跑还有就是不能绕过用户密码。在此只做参考,可以在此基础上继续完善
复制代码用记事本打开,保存为.bat档,使用Administrator运行。
@echo off
echo Author:Hama_Tago Time:2017/9/5echo ====================================
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
::restartecho %b% >>log.log
echo %date% %time% >>log.log
cd c:\windows\system32
shutdown -r -t 0
pause >nul
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
版权声明:本文标题:实现电脑重启指定次数的bat 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1728932430a1180432.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论