I'm trying to teach myself Python. As a small intro project, I've trying to build a program which allows you to turn off or send a computer to sleep after a user defined set of time.
I had no issue with turning the computer off, but am having difficulty sending it to sleep (after 60 minutes for example)
I have the command to send the computer to sleep but I am having difficulty setting the time in which the program waits before it happens:
powercfg -h off & start /min "" C:\WINDOWS\System32\rundll32.exe PowrProf.dll,SetSuspendState 0,1,0 & ping -n 3 127.0.0.1 > nul & powercfg -h on & exit
Thank you for taking the time to read this, if you could point me in the right direction I would be extremely thankful.