Skip to content

Instantly share code, notes, and snippets.

@valdergallo
Last active February 22, 2024 13:59
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save valdergallo/0e05d9e0c90b7be77458 to your computer and use it in GitHub Desktop.
Save valdergallo/0e05d9e0c90b7be77458 to your computer and use it in GitHub Desktop.
Script to make windows stop to sleep using VBscript
set wsc = CreateObject("WScript.Shell")
Do
'Five minutes
WScript.Sleep(5*60*1000)
wsc.SendKeys("{NUMLOCK}")
Loop
@sriramkannan95
Copy link

Good one. But toggling the Numlock every five minutes might annoy some people. I suggest using this instead:
wsc.SendKeys("{F13}")
F13 functionality is still not implemented in Windows. It is left for future use. But it is a valid key. So using this won't affect any other operations

@GeorgiKarapetrov
Copy link

Or you can send NUMLOCK twice in each iteration. Thanks for this.

@aboee
Copy link

aboee commented Nov 5, 2020

Hi,

I run it but i need to stop it ? please guide me

@GeorgiKarapetrov
Copy link

You could run it in cmd and close cmd when you want to stop it.

@valdergallo
Copy link
Author

valdergallo commented Nov 10, 2020

You could use task manager to kill the command

@sumitbsn
Copy link

You can run it from cmd and then use ctrl+c in case if you want to stop.
cmd:> cscript scriptname.vbs

@tdas777
Copy link

tdas777 commented Apr 20, 2021

Hi,
It's working. But i want to add a condition, if on AC power then send keys.
Please guide.

@mdnoor123
Copy link

Above code is not working for me. Sapience buddy(time tracking tool) unable to track this timing. Pkease help me

@mdnoor123
Copy link

"Hi All,

Can you please tell me how to get rid of sapience buddy (time tracking tool). Am unable to convert offline hours to work time hours since its disabled by admin.

Even if i am browsing over stack overflow /oracle/IBM docs website or any learning platform its taking it as offline hours.

Other than company website its taking it as offline hours.

And My manager telling me to complete 9 hrs in work time which is on company website only and it is not possible for me to do.

From last 2 week am sitting infront of system for approx 13 hrs/day (including browsing hrs)

Note:- 1) i am not using youtube/netflix or any other OTT platforms to spend approx 13 hrs/day.
2) Even i tried all the ways to keep system on at all time and no outcome of it.

Kindly suggest me how to tackle this.

TIA"

@RamprakashGovindaraj
Copy link

works like a charm!! thanks @valdergallo and @sriramkannan95

@ashishkel
Copy link

Nice :)

@Laicure
Copy link

Laicure commented Jul 22, 2022

I always return here whenever I set up a new work pc/laptop :D

@valdergallo
Copy link
Author

hahahaha

@vishnu4net
Copy link

how to set this for 30 seconds bro?

@valdergallo
Copy link
Author

valdergallo commented Aug 8, 2022

'Five minutes
WScript.Sleep(5*60*1000)

soo

'thirty minutes
WScript.Sleep(30*60*1000)

@VedanshMalviya36
Copy link

I Have A Code Of Prank
x=msgbox("Your Message", 0+16, "Your Title")

@VedanshMalviya36
Copy link

This Is A Prank Error Code

@VedanshMalviya36
Copy link

1

@VedanshMalviya36
Copy link

@echo off
:a
color 2
echo 1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 1
ping localhost -n 1 > nul
echo 1 1 0 1 1 1 0 0 0 1 0 1 a f h 0 0 0 1 0 1 1 0 0 1 1 1 0 0 1 0 1 0 0 1 1 0
echo 1 0 0 1 1 0 9 8 1 2 0 1 9 9 2 1 1 1 0 0 1 0 1 1 1 0 1 1 0 1 0 0 0 1 0 1 1
ping localhost -n 1 > nul
echo 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 01 0 1 0 0 1 0
ping localhost -n 1 > nul
echo 1 0 1 1 1 0 1 1 0 9 1 1 2 1 1 0 9 1 0 5 7 7 8 7 8 1 3 2 1 2 1 2 3 2 1 3 4
ping localhost -n 1 > nul
echo 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 0 1 1 1 4 1 2 1 1 2 0 1 0 1 2 2 1 0 1 1 0 1
goto a

@VedanshMalviya36
Copy link

This Is A Matrix Code
VBS File

@mck1915195
Copy link

Or you can send NUMLOCK twice in each iteration. Thanks for this.

@Laicure
Copy link

Laicure commented Sep 19, 2023

You should know that this haxx also works as a real mouse/keyboard "jiggler".
It makes MS Teams' presence consistent! (only works on the app, not the web app)

No more auto-"away"!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment