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.
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:
Now with batch files there are various ways to "communicate".
For example:
We will be using all of them except echo as it is pretty self-explanatory.
Basically to start off with you should open notepad and type:
@echo offWhat 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 worldGo 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. :D
Start off with a blank notepad document and type this:
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.
Start off with a blank notepad document and type this:
@echo offshutdown -spauseshutdown -amsg * tricked you!! hahaNow 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.
Attachments
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:
: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:Startstart fork.batGOTO StartSave 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 StartWhich 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!
Go an hone you newly learnt skill and have phun!