Maybe this wasn't as hard for you as it was for me. But after reading (countless) entries on Wake/Sleep via Task Scheduler in Windows 10, I've finally got it figured out.
My goal was to have my Arcade Cabinet - running Attract Mode - Sleep at night. But be awake when I come downstairs in the morning to greet me <grin>. I also combined this with a (cool and cheap) powerstrip from Home Depot with a timer, so as to turn the monitor and marquee power off at the same time.
Following is the magic Task Scheduler commands that make it work under Windows 10.
Note: You have to download PSTOOLS, but it's free. Find it here:
https://docs.microsoft.com/en-us/sysinternals/downloads/pstoolsNOTE: Using Windows rundll32.exe isntead of pstools is nothing but trouble...
I scheduled 3 different events: (1) Kill attract.exe process at 10pm (2) Sleep the PC at 1005pm (3) Wake the PC at 600am by starting a new copy of attract.exe.
Note that I leave 5 minutes between (1) Kill attract.exe and (2) Sleep the PC. One minute was sometimes (rarely) not enough, and it caused issues. This method works fine.
In Task Scheduler, create 3 "Basic Tasks" one at a time. Setup On/Off times, then go to each inividual "Actions" tab and enter the following commands as indicated. Note for the first two, nothing is entered in the optional "Start" section - this is only used for the 3rd (Wake) item.
------------------------
(1) Kill AttractMode
Setup On/Off Times, then go to the "Actions Tab"
Program: taskkill.exe
Arguments: /im attract.exe
Start:
(2) Sleep PC
Setup On/Off Times, then go to the "Actions Tab"
Program: c:/pstools/psshutdown.exe
Arguments: -d -t 0 -accepteula
Start:
(3) WakeAttractMode
Setup On/Off Times, then go to the "Actions Tab"
Program: attract.exe
Arguments:
Start: c:\attractmode
Every night at 10pm, AttractMode (nicely) shuts down. 5 minutes later, the PC quietly goes to sleep. At 6am the next morning, AttractMode starts. Make sure in WakeAttractMode that you put your OWN directory of where you have AttractMode installed (mine is c:\attractmode.) This is the only one of the 3 that needs a "Start" option entered.
Good luck.