@echo off title restart 自动化脚本 :again tasklist|findstr -i "notepad.exe" ifERRORLEVEL1 ( echo notepad is off in%Date:~0,4%-%Date:~5,2%-%Date:~8,2%%Time:~0,2%:%Time:~3,2% start "" "C:/Windows/notepad.exe" ) cd /d "D:/" choice /t 30 /d y /n > nul goto again