不管是学习、工作,还是玩,有的时候会在电脑旁边待很长时间,为了让自己注意身体,就写了这样一个批处理,在适当的时候提醒自己

 

  1. @echo off  
  2. reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v 该休息啦.bat /t reg_sz >nul  
  3. @echo off  
  4. :start  
  5.  
  6. for /f "delims=: tokens=2" %%i in ('systeminfo ^| findstr "系统启动时间"') do set a=%%i  
  7. set var=%a:~2,1%  
  8. if "var" geq 2 (goto alert) else goto start  
  9. :alert  
  10. echo msgbox "该休息啦">alert.vbs  
  11. call alert  
  12. del /f/q alert.vbs,time.txt  
  13. pause  
  14.  
  15.  
  16. ::systeminfo | find "系统启动时间">"%cd%\time.txt"