3

It doesn't seem like this would be very difficult, but how can I wake-up a PC by doing the equivalent of moving a mouse or pressing keys on a keyboard?

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.

I'm trying to use EventGhost to receive a TCP/IP command that tells the PC to wake up the displays but it's proving quite difficult.

3
  • Wake on Lan
    – Moab
    Dec 28, 2015 at 21:05
  • howtogeek.com/70374/…
    – Moab
    Dec 28, 2015 at 21:07
  • Do you want to prevent going to sleep, like mimicking 'activity' events or as others linked, you are looking for a Wake-on-LAN utility? I believe it's the former, see if wscript.SendKeys will do the trick.
    – AlexPawlak
    Dec 28, 2015 at 21:19

1 Answer 1

3

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .