How can I wake-up a PC using a command? (i.e. equivalent to moving a mouse, etc)

Solution 1:

How can I wake-up a PC using a command? (i.e. equivalent to moving a mouse, etc)

My PC is running Windows 10 and I only have the monitors enter sleep mode after 15 minutes. The rest of the PC is still awake and doesn't use hibernate, etc

2-Part Solution Suggestion


Solution Part One

Create a batch script (example in solution part two below) that emulates keyboard key strokes. Schedule it with Windows Task Scheduler and tell it to wake up the computer to run the task at designated time(s) just in case you also need to "wake the computer" otherwise at those times—more than just the sleeping monitor (see source below for detailed instructions).

(Again, example batch script at bottom to use for scheduling along with logic native to Windows that emulates keyboard strokes (SendKeys) which will wake up the sleeping monitor.)

SOURCE: How to Make Your PC Wake From Sleep Automatically - Further Detail

enter image description here


Solution Part Two

Use the below batch script logic to natively emulate keyboard key strokes with a dynamically built and executed VBS script with batch though. This will be the batch script to execute logic-wise as an example.

Example batch script sending space mulitple times like pressing the spacebar

(You can use any other keys you need to with SendKeys as well)

@ECHO OFF
SET TempVBSFile=%tmp%\~tmpSendKeysTemp.vbs

:VBSDynamicBuild
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
ECHO Set WshShell = WScript.CreateObject("WScript.Shell") >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"
ECHO Wscript.Sleep 500                                    >>"%TempVBSFile%"
ECHO WshShell.SendKeys " "                                >>"%TempVBSFile%"

CSCRIPT //nologo "%TempVBSFile%"
GOTO EOF