Short answer: you can make your keyboard's Caps Lock, Num Lock and Scroll Lock LEDs flash like a mini disco using a tiny Windows VBScript, no software needed. It is a classic, harmless trick I still enjoy showing people. Here is the script, how it works, how to stop it, and a few other fun tricks, plus the safety notes that matter.
The disco LED trick
- Open Notepad.
- Paste this exactly:
Set wshShell = wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wshshell.sendkeys "{NUMLOCK}"
wshshell.sendkeys "{SCROLLLOCK}"
loop
- Save it as Disco.vbs (choose "All files" as the type so it does not save as .txt).
- Double-click the file. Your keyboard LEDs will flash in rhythm.
How it works
The script creates a Windows Shell object and, in an endless loop, sends the Caps/Num/Scroll Lock key presses every 100 milliseconds. Each press toggles that lock's LED, so they blink rapidly. The wscript.sleep 100 sets the speed, lower the number for a faster flash.
How to stop it (important)
Because it runs in an infinite loop, it will not stop on its own. To end it:
- Open Task Manager (Ctrl + Shift + Esc).
- Find Microsoft Windows Based Script Host (wscript.exe).
- Select it and click End task.
Your keyboard also becomes twitchy while it runs (the locks keep toggling), so stop it before you need to type normally.
A couple more harmless fun scripts
- Talking PC: a one-line VBScript with
CreateObject("SAPI.SpVoice").Speak "Hello"makes Windows say a phrase aloud. - Auto-typing: SendKeys can type a message into the active window, fun for a harmless prank on your own PC.
The non-obvious safety note
VBScript is powerful, which is exactly why you should only run scripts you understand. Never double-click a .vbs file someone sends you, the same SendKeys and Shell features that make a harmless disco can be used maliciously. Type these yourself from a source you trust, like this one, and read what each line does first.
Frequently asked questions
How do I make my keyboard LEDs flash like a disco?
Paste the provided VBScript into Notepad, save it as Disco.vbs, and double-click it. It toggles the Caps, Num and Scroll Lock LEDs in a loop.
How do I stop the disco keyboard script?
Open Task Manager, find Microsoft Windows Based Script Host (wscript.exe), select it, and click End task. It runs in an infinite loop otherwise.
Is the disco VBScript safe?
The script itself is harmless and just toggles lock keys. But only ever run .vbs files you understand or wrote yourself, never ones sent by others.
Can I change the flashing speed?
Yes. The wscript.sleep 100 line sets the delay in milliseconds. Lower it for faster flashing, raise it to slow it down.
Comments
Post a Comment
If you have anything in mind, please let me know!