Introduction: Batch + CMD Small Tutorial

Hey Guys Welcome Back To Another Batch Instructable.


In This Is Instructable I'am Going To Show You Guys Some Of The Basics Of Using Both Batch Files and CMD...

So Guys If You Liked This Little Tutorial And Want Me To Make More Or You Want Me To Make A Batch File For You Or Maybe Just Want To know How It Works Or Again even If You just Want A Different Tutorial Please Let Me Know In the Comments Or By Emailing Me At MidgetCoder@gmail.com

Step 1: Batch File Basics

Before We Start I'm Going To Say The "  " Are Only To Show You What To Type In The Batch File They Are Not To Be Written Unless I Say That We Need To Put The "  "..................Thank You.

So To Start Off You Are Going To Need To Open A .txt Document Or (if you have got it) Notepad++ (I highly recommend getting it if you want to keep going with batch files).

Then Type "@echo off" This Means That Whenever You Write anything For Example.........echo Hello There It Will Not Show The Origin Of The Statement, By That I Mean That If You Leave Echo On It Will Say For Example
C:\Users\MidgetCoder\Desktop\Batch> Hello There, So We Obviously Don't Want That

After You Have Written @echo off Press Enter 1 Or 2 Times Depending On Whether Or Not You Like All Of Your Programming To Be Right Underneath Each Other Or Not (I personally  press it 2 times) You Will Need To Write "echo Hello World!" This Will Make "Hello World!' Be Displayed On Your Screen Then Press Enter Once And Write "Pause" This Means That The Batch File Will Not Show The Next command Until You Press A Key.

Once You Have Finished That Go To The Top Left Corner And Go To 'File' Then 'Save As', Name It Whatever You Want I.E. Hello.bat Make Sure You Have .bat Written At The end Of The Name And Have The File Type Set To 'All Files' Then Save It.
When You Go Into It All That Will Happen Is, A Window Will Come Up Onto Your Screen And It Will Say "Hello There" And Then Under It Says "Press Any Key To Continue" If IT Says Anything different You Have Done Something Wrong If It Is All Good Then Congratulations You Have Successfully Learned Hoe To Write Something Using A Batch File.

So Guys If You Liked This Little Tutorial And Want Me To Make More Or You Want Me To Make A Batch File For You Or Maybe Just Want To know How It Works Or Again even If You just Want A Different Tutorial Please Let Me Know In the Comments Or By Emailing Me At MidgetCoder@gmail.com

Thanks Guys Have A Good Day. And Dont Forget To Keep Going  With The Next Step Where I Will show You Some Basics When Using CMD Or Command Prompt.

Step 2: CMD Basics

Before We Start I'm Going To Say The "  " Are Only To Show You What To Type Into CMD, They Are Not To Be Written Unless I Say That We Need To Put The "  "..................Thank You.

Ok So Now Onto CMD.
CMD Is Like A Direct Batch File You Open It You Type The Code And Press Enter, You Don't Have To Save It At All.

First You Will Need To Go To Start Menu, Search For CMD And Then Open It.
once Open You Can Now Effectively control The Computer But Today We Are Going To Learn A Really Simple Shutdown Code

If You Want To Look at All The Types Of Things You Can Do With Shutdown Simply Type "Shutdown" And On Your Screen Will Be A Large amount Of Different Codes That Can Be Used With The Shutdown Code Such As -s Which Simply Shuts The Computer Down When Used With -f and -t 00, That's Exactly what we Are Going To Learn Today.

So I'am Now Going To Go Through What The Different Parts Of The Code Means;

The "shutdown" Part Is Telling The Computer Of The action That We Want To Do.

The "-s" Part Is Telling The Computer That We Want To Shutdown The Computer.

The "-f" Part Is Telling The Computer That We Want To Close All Of The Tabs So That It Doesnt Have To Wait For The Windows To
              Closed.

The "-t 00" Part Is A Timer And We Are telling The Computer That We Want To Be Shutdown In 0 Seconds,
                    (You can change The 00 To Whatever Amount Of Seconds That You Would Like)

So When We Type "Shutdown -s -f -t 00" We Are Telling The Computer To Shutdown The Computer ASAP And Not To wait For The Windows To Be Closed Manually.



So Guys If You Liked This Little Tutorial And Want Me To Make More Or You Want Me To Make A Batch File For You Or Maybe Just Want To know How It Works Or Again even If You just Want A Different Tutorial Please Let Me Know In the Comments Or By Emailing Me At MidgetCoder@gmail.com

Thanks Guys Have A Good Day. And Don't Forget To go To The Previous Step and Have A Look At How To Write Something Using A Batch file