Short answer: you can make a harmless joke script in Notepad that keeps popping open the CD/DVD drive, great for a laugh on a friend's PC that has an optical drive. It is a few lines of VBScript, changes nothing, and stops the moment you close it. Here is the code, how it works, how to stop it, and the safety line you must not cross.
A note before you prank anyone
This is only funny on a computer you have permission to use, and only harmless because it changes nothing. Do not run scripts on someone's work machine or anywhere it could cause real trouble. A prank that annoys a friend for ten seconds is fine; one that disrupts someone's work is not.
The CD-eject prank code
- Open Notepad.
- Paste this:
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop
- Save it as prank.vbs (choose "All files" so it does not save as .txt).
- Double-click it. Every five seconds, any optical drive pops open. Push it back in and it opens again.
How it works
- It creates a Windows Media Player object to access the CD-ROM collection.
- The
do ... loopruns forever, ejecting each drive it finds. wscript.sleep 5000waits five seconds between each eject.
It only sends the "eject" command, the same one the drive's own button does, so nothing is harmed.
How to stop it (important)
Because it loops forever, it will not stop on its own:
- Open Task Manager (Ctrl+Shift+Esc).
- Find Microsoft Windows Based Script Host (wscript.exe).
- Select it and click End task.
The ejecting stops immediately, and nothing is left running or changed.
The non-obvious safety point
This prank is harmless, but it lives in the same .vbs format that real malware uses. That is exactly why you should never double-click a .vbs file someone sends you, even as a "joke". Type these yourself from a source you trust and read what each line does. Most modern laptops also lack an optical drive, so on those this simply does nothing, no harm at all.
Frequently asked questions
How do I make a harmless funny virus in Notepad?
Paste the provided VBScript into Notepad, save it as prank.vbs (All files type), and run it. It keeps ejecting the CD/DVD drive and changes nothing.
How do I stop the CD-eject prank?
Open Task Manager, find Microsoft Windows Based Script Host (wscript.exe), select it and click End task. It stops immediately.
Is the Notepad eject prank actually a virus?
No. It only sends the normal eject command in a loop and harms nothing. It is a joke script, not real malware.
Is it safe to run .vbs files people send me?
No. Never double-click a .vbs from someone else, even as a joke, since the format can run real malicious commands. Only run scripts you wrote or understand.
Comments
Post a Comment
If you have anything in mind, please let me know!