Skip to main content

Windows Scripting

Auto Restart With A Delay Via a Bat Script

Useful for battle testing a computer with a naughty power supply. 

@echo off
echo Your computer will restart in 2 minutes. Press Ctrl+C to cancel now.
timeout /t 30
shutdown /r /f /t 90 /c "Restarting in 2 minutes. Cancelled if interrupted."

Auto Launch Some Applications With A Delay Via a Bat Script

Open up notepad, copy and paste the below code, replace with whatever file(s) + path(s) and whatever startup delays you want, save it as a .bat and throw it in shell:startup. I recommend doing a test with some garbage.txt files first just to make sure you did it right!

@echo off
timeout /t 30 /nobreak
start "" "C:\Users\CAM\Desktop\garbage.txt"
timeout /t 30 /nobreak
start "" "C:\Users\CAM\Desktop\garbage-2.txt"