PCSTATS     
[X]   Directory of
Guides & Reviews

Beginners Guides
Motherboards by Brand
Weekly Newsletter
Archived Newsletters

+70 MORE Beginner GUIDES....
Beginners Guides: Understanding and Creating Batch Files
Beginners Guides: Understanding and Creating Batch Files - PCSTATS
Batch files can save time by automating actions down to one simple click. A good understanding of what they are, how they work, and how to create your own, is crucial to today's IT force.
Filed under: Beginners Guides Published:  Author: 
External Mfg. Website: PCSTATS Apr 04 2011   M. Dowler  
Home > Reviews > Beginners Guides > PCSTATS

Beginners Guides: Understanding and Creating Batch Files


Batch files can save time by automating specific actions taken on the computer down to one simple click. They can also potentially hide damaging code, so a good understanding of what they are, how they work, and how to create your own, is crucial to today's IT force. - Version 1.2.0

In this Beginners Guide, PCSTATS is going to walk you through one of the simplest but potentially most powerful ways to customize and simplify the management of your computer: batch files. These text files are easy to create, and only as complex as you want them to be, but they can perform many useful operations from file backups to system configuration quickly and automatically.

At their simplest, batch files are text files which execute one or more command prompt commands in a specific order. The power of a batch file lies in the way that it allows you to combine multiple commands into one batch file 'program' and customize the way that each command operates.

In this article PCSTATS will illustrate what batch files are good for and how to create them. By creating a useful series of batch files designed to allow you to selectively back up files from one location to another, we'll demonstrate the ways that batch files can make your computing life easier while you learn the various option involved in creating them.

What can batch files do for you?

If you read PCSTATS Guide to the Windows XP Command Prompt, you'll have a passing familiarity with several very useful command prompt commands. Batch files can incorporate any command prompt command (including the switches for that command), execute multiple commands in sequence and choose which commands to use based on user input or the results of previous commands. Essentially, anything you can do in the command prompt you can do better and faster with batch files once you have prepared them.

This article deals exclusively with using the Microsoft Windows XP/2K command prompt to create batch files, so commands here may not be 100% compatible with earlier versions of Windows which used a true DOS prompt (and the same holds true in reverse; true DOS batch files may not work under Windows XP). The range of commands available to produce batch files actually decreased with the Windows XP/2K command prompt implementation, but the essential functions are still present.

How are batch files created?

As we've said, batch files are simply text files, so all you need to create one is the Windows notepad application. Don't use WordPad or a word processor like Microsoft Word; these do not produce 'pure' text files by default, since they add their own text formatting.

To create a simple batch file, all you need is a single command you want to run, typed into a text file and saved with the .BAT extension, like 'mybatchfile.bat'. Double click this file and it will run your command. Let's test it out...

© 2023 PCSTATS.com
Please respect the time and effort that went into creating each PCSTATS Beginners Guide, do not illegally copy. Thank you.
Next Page >

 

Contents of Article: PCSTATS
 Pg 1.  — Beginners Guides: Understanding and Creating Batch Files
 Pg 2.  Creating a BATCH File
 Pg 3.  Preparing for your second batch file
 Pg 4.  Anatomy of a batch file
 Pg 5.  Third trial batch file: getting fancy
 Pg 6.  Batch file error levels and the goto command

 
Hardware Sections 


 
PCSTATS Network Features Information About Us Contact
FrostyTech
PCSTATS Newsletter
Tech Glossary
Technology WebSite Listings
News Archives
(Review RSS Feed)
Site Map
PCstats Wallpaper
About Us
Privacy Policy
Advertise on PCSTATS

How's Our Driving?
© Copyright 1999-2023 www.pcstats.com All rights reserved. Privacy policy and Terms of Use.