I’m trying to get a Windows 10 Optiplex 7000 to go to sleep at 10pm every day. I installed nircmd and created a task in task scheduler to run a .bat file with the following command: nircmd.exe monitor async_off
Running this batch file manually (by double clicking it) works just fine. However, if I have the “Run whether user is logged on or not” option selected, and I try to run the task in task scheduler (by clicking the run button) it seems like nothing happens. The batch file is running; I can create files with the output of echo
and whoami
, but for some reason the nircmd command doesn’t seem to execute successfully. If I instead select “Run only when user is logged on” the task works.
The output of whoami
is the same for both configurations, so I don’t think it’s a problem with user permissions. The user who’s logged in when the command needs to run doesn’t have permission to sleep the computer, so I don’t think I can just create the task as them and have it configured to only run when they’re logged in.
Does anyone have any ideas I can try? Perhaps a different command I can use to invoke S0 sleep?
(I’ve already tried psshutdown
and rundll32.exe
, and neither work because they only invoke S3 sleep which isn’t supported by the computer’s firmware, according to powercfg -a
)