How to Make a Batch File
Batch files are the computer handyman’s method for completing things. They can automate everyday tasks, shorten the required time to accomplish something, and translate a complex process into something anyone could operate.
See Also:
Since automation programs like AutoHotKey exist, many people have never written or taken the time to understand bat files, and many don’t even know what they do.
Batch files or scripts are small easy-to-write text files that carry out a series of commands. They can be simple enough that even the average home computer user can take advantage of them.
What is a batch file?
A batch file contains a series of DOS commands, and is generally composed to mechanize regularly performed tasks. Rather than writing the same commands again and again, you can basically double tap the batch file. Composing a batch file is easier than it looks; the troublesome part is ensuring that everything happens organized appropriately. Well-made batch files can save you a lot of time over the long run, particularly on the off chance that you deal in repetitive tasks.
These are simple text files containing some lines with commands that get executed in sequence, one after the other. These files have the unique extension BAT. Files of this type are perceived and executed through an interface (infrequently called a shell) gave by a system file called the command interpreter. In Windows XP/Vista the command interpreter is the file cmd.exe.
In this article, I’m going to show you how to write a simple batch file and present some basics that a user will need to understand when writing one.
Step to creating a batch file in Microsoft Windows
You can use any text editor (such as Notepad or WordPad) to create your batch files, as long as the file extension ends with .bat. You can create a batch file using the steps below:
1) Open Notepad: Notepad provided with operating systems and software development packages, and can be used to change configuration files, documentation files and programming language source code. You can open Notepad by clicking Start → Programs → Accessories → Notepad. Also you can open notepad through Run box. Just write notepad in the Run box to open it.
2) Write a Program:
@echo off echo We are going to list all files in Intel Directory using bat pause dir C:\Intel pause
3) Run the Batch File To run the batch file, double-click on it. Once the batch file has completed running it closes automatically.
Some Basic Batch Commands: Batch files run a series of DOS commands, so the commands that you can use are similar to DOS commands. Some of the more important ones include:
Enjoy it!