Introduction: Batch Tutorial - Take 1

Well i have seen a few batch tutorials out there, but none of them really follow up with anything so I'm making a 3 part tutorial on batch, with videos just for that extra ease.

I will attach all .bat (batch) files needed in their appropriate
step.



Step 1: Hello World!

To start of to open the Command Prompt just click "Start => Run and type 'cmd'"

Basically to start off with you should open notepad and type:
@echo off
What this does is essentially block the command from showing while still showing the output.
Now with batch files there are various ways to "communicate".
For example:
@echo offecho hello worldmsg * hello worldnet send * hello world
Go ahead and write that into notepad and save it as com.bat. Then double click to start.
We will be using all of them except echo as it is pretty self-explanatory.

Attachments

Step 2: A Little More "tricky"

Okay now we get into a little more complicated, we'll not really. :D

Start off with a blank notepad document and type this:
@echo offshutdown -spauseshutdown -amsg * tricked you!! haha
Now shutdown basically just shutdowns the computer. Look at the video for a more in detail look or type shutdown -? into cmd.

pause basically waits for you to press ANY KEY to continue.

And you know what msg does from the previous step..

Try this out by saving it as tricky.bat.

Step 3: Fork Bombs / Infinite Loop (the GOTO Trap)

Basically all a fork bomb is, is a program that keeps opening copies of itself which open up copies of itself, and so on and so forth. Well a VERY basic fork bomb would be:
@echo off:Startstart fork.batGOTO Start
Save as fork.bat
:Start marks a place in the script to which you may want to GOTO later or quicker then planned.
GOTO tells the program to go to a specific part

start basically "starts" something it can be a webpage, anything.
eg, start http://instructables.com''

This GOTO trap last forever until the user either breaks the process of the computer crashes.
The start fork.bat can be replaced with any command you like, for example;
@echo off:Startnet send * laconix rules!GOTO Start
Which basically send the text "laconix rules!" to anyone on your network with the Messenger Service running.

Attachments

Step 4: Have Fun...

Hope your eager for the next tutorial, i know i am!

Go an hone you newly learnt skill and have phun!