@echo off set hour=%time:~0,2% if %hour% GEQ 22 if %hour% LEQ 6 goto sd at 22:00 shutdown /s /t 20 exit :sd shutdown /s /t 30