5.8. Batch File Basics
The first part of this chapter shows you several basic commands that make the command prompt easier to use — as well as a powerful ally. In the following sections, you find out how to write a batch file, which makes the command prompt an even more powerful tool. A batch file is simply a string of commands, which could have been typed at a command prompt, chained together to automate a process.
5.8.1. Starting your file
To start, you need a place to put the commands that you want to execute. To do this, open the text editor of your choice, make a new text file, and save it with a .bat extension.
|
If you want file extensions to show, use the following steps:
Open My Computer or Computer for Vista users.
Choose ToolsFolder Options.
Click the View tab.
Clear (to show) the Hide File Extensions for Known File Types check box.
Click OK.
With your batch file open in the text editor, you can now type any commands you want, but remember to put only one command per line in your file. You can use this file to create, copy, or delete files, or anything else that you ...
Get CompTIA A+® Certification All-In-One For Dummies®, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.