@echo 每小時(shí)檢查主機(jī)是否能Ping通自己的域名,如果不能,則重新啟動(dòng)機(jī)器,如裝防火墻過(guò)濾,請(qǐng)考慮其他辦法,或開(kāi)放ICMP協(xié)議 @echo 檢查中...... @echo off echo execute-date:>>c:/checktoreboot.log date /t>>c:/checktoreboot.log echo execute-time:>>c:/checktoreboot.log time /t>>c:/checktoreboot.log
set hh=%time:~0,2% set /a hh +=1 if /i %hh% GEQ 24 set /a hh = 0 at %hh%:00 C:/CheckToReboot.bat ping -n 1 www.yourname.com|find "Request" && shutdown -r echo ==============================================>>c:/checktoreboot.log @echo on @echo 檢查完畢!