Putting a computer to sleep on a timer using a batch file.

As the subject says, I would love a .bat file that will put my computer to sleep in 2 hours, 72,000 seconds. Can someone help me out?
Answer
Answer
Hi Lovejoy89,

Please, could you replace the line "timeout 72000 > NUL" (these are 20 hours) for the next below:

@echo off
echo %time%
timeout /T 7200 && rundll32.exe powrprof.dll,SetSuspendState 0,1,0
echo %time%

I hope to operate fine now. Please, tell us the results.

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 20, 2025 Views 2,758 Applies to: