What are the Batch Files

written by: Johnny Stenthal; article published: year 2007, month 01;


In: Categories » Computers and technology » Microsoft OS family » What are the Batch Files

Batch files are, in essence, command-line commands typed into a text file rather than typed directly at the command prompt. You can tell the command shell to read this text file and interpret its commands as if you were typing them. This serves several purposes:

  • It can save you a lot of typing, as you only need to type the batch file commands once, but you can have Windows run the commands as many times as you want. This is really important with long sequences of commands, but I even more frequently write what I call "tiny handy batch files," with single letter names, and perhaps only one command inside, to do things like change the current directory to a commonly used folder. These batch files can save you quite a bit of time and trouble.

  • You can write the batch file in such a way that it records steps of a particular job without storing the particulars; you can then provide the particulars when you use the batch file. For example, if you repeatedly have to extract and print information from different data files, you might write a batch file that performs these steps but doesn't contain the name of the actual data file to be processed. You can supply that name when you use the batch file. This, again, can save you time and mental energy: After the batch file is written, you don't have to think about what's inside the batch file. It's just a new Windows command that you can use whenever you need.

  • The contents of the batch file serve as a form of documentation, which lists the steps necessary to perform a particular job. A year after you've completed some project, you might have forgotten the steps involved in processing your data files, but you can always read the batch file yourself to refresh your memory.

Batch files can also use primitive programming commands to handle varying situations: "if a particular situation arises, do this, otherwise, do that" or "repeat this step for every file in a certain folder."

legal disclaimer

1) Our website is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. Please read the Terms of service

Useful tools and features

Translate this article to...    Send this article to you or to a friend

Link to this article from your page   
If you like this article (tutorial), please link to it from your web page using the information above. Linking to this page, this is the only way to help us improve our service, the same time providing your visitors with a way to improve their online experience.

related articles

1. How to Configure Automatic Updates in Windows XP
Automatic Updates is a mechanism with an awkwardly plural-sounding name by which Microsoft or corporate network managers distribute critical security updates to Windows users. Fixes sent by this means are considered so important for adequate security in the hostile Internet environment that Microsoft prefers that you configure it to download and install the updates, and if necessary even restart your computer without your being aware of it. There are four levels of Automatic Updates protection to which you can subscribe:...

2. MS DOS Versus PC DOS
With modern PCs having a very high level of standardization and compatibility, today it is easy to see how Microsoft can market complete packaged operating systems that will install and work unmodified on practically any PC you can purchase or build. Without the standardization and compatibility we have come to depend on, different specific "flavors" of a given operating system would be required for specific different hardware. That is exactly how things were back in the early '80s when the IBM PC was introduced. Many o...

3. How to make your PC Available for Remote Desktop Connection
To use Remote Desktop to reach your computer from the Internet, both the computer and your Internet connection must always be up and running. In addition, you must be able to make connections from the outside world to your computer, so there are additional requirements: If you use dial-up Internet service, you'll need someone at home to establish the connection before you can connect to your computer. If you use cable or DSL Internet service, you must either have a static IP address ass...

4. How to Update DirectX ~ Advantages
Although most Windows applications place fairly low demands on the display system, putting up fairly static displays and updating them relatively infrequently, interactive games and video displays are very graphics intensive. Game players pay big bucks for fps, or frames per second, which is a measure of how fast the hardware and software can generate new images as the scene changes and objects move. Under about 30fps, the image flickers and motion is noticeably jerky. Beyond 30fps, faster updates aren't noticeable, and the e...

5. Using Simple File Sharing in Windows
Although most home users are typically happy letting anyone at any computer read or modify any file, business users need to restrict access to files with payroll, personnel, and proprietary information. Windows XP and its predecessors, Windows NT and Windows 2000, were primarily designed for business use, so they require usernames and passwords for identification, and have a security system that lets computer owners restrict access to sensitive files on a user-by-user and file-by-file basis on each computer. Unfortunate...

6. The Evolution of Microsoft Windows ~ The Windows 9x Family
By the mid-1990s, processor power had increased and memory prices had decreased dramatically since Windows' original release. The Internet had also sprung onto the world stage, from an academic tool to an instrument of global communication and commerce. (You may recall that Windows 3.1 did not even include support for the TCP/IP network protocol used on the Internetyou had to purchase it from a third-party vendor.) Users' expectations likewise had grown with computers' capabilities, and desktop publishing, graphics editing, and...

7. How to install Windows and Installation Types
Deciding on the type of installation to perform is dictated by many factors, such as the following: Is there an operating system currently installed? If so, do you want to preserve settings and configurations, or start from scratch? Will the installation be performed interactively or remotely? How many computers are to be installed at a single time? Is your network arranged in a domain model using Active Directory? These are ...

8. How to adjust Text Icons and Window Element Sizes
If you find the items on the screen difficult to read or see, you can either lower the screen resolution, which makes everything larger but blurrier, or ask Windows to make the elements themselves larger while keeping a crisper, high screen resolution. There are two ways you can do this. Here's the first procedure: 1. Right-click the Desktop and select Properties. 2. Save the current screen settings so if you're unhappy with the results, you can back the changes out. Select the Themes tab, click Save As, and enter ...