How to create a batch file

Page 1

How to create a batch file? BATCH FILE is nothing but a text file which contains a series of batch or dos commands which can be executed sequentially and in Desired order. A batch file is created to reduce time by executing same commands Which is used to run frequently? To create one of this file you don’t need special programming skills just some basic understanding of MS-DOS and dos commands. A Batch file has a extension .BAT and any primary name or first name of your choice. To run a batch file you just need to type the primary name of a file in dos prompt for Example :: I have created a batch file name abc.bat to run this I will type abc in dos prompt and will Press Enter. Autoexec.bat is a prime example of a batch file which was used in earlier windows and msdos it would have necessary boot files which used to load every time computer booted.

How to Write a Batch File? Step No 1 :: Go to Start ----> Run--- >Cmd Step No 2 :: Type the following Dos Commands to create a Batch file • • • • • •

c:\>copy con abc.bat (Press Enter) dir dir/p/w copy con del pa.exe PRESS CTRL+Z OR F6 To save the file

Now To run this .bat file just type abc in the command windows without the extension. The command which I have included in .bat file will be executed sequentially that means dir command will be executed first then dir/p/w then copy con so on all this command will be executed in an order.

Create .Bat file using Notepad


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.