What is the batch file ?


Batch file is the file, which contains the collection command which should to be executed by command prompt. Batch file make user life more easier.

If user will click on batch file all the set of dos command statement will be executed. Batch file is also know as .bat extension file.

How to create the batch file ?

We can create the simple batch like this steps

Step 1 : Open the notepad file

Step 2 : Type this code in batch file

@echo off
echo Hello this a test batch file
pause
dir c:\windows
pause

Note: Here echo is used to display the message in Dos prompt and pause is used to hold the screen

Step 3: Save the file as .bat extension like this

Step 4: Double click on Test.bat file, you will get the output like given below

Summary:
In the above sample we saw that without writing the code in command prompt we can execute some set of command.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.