Using Common DOS Utilities
You'll find a number of common DOS utilities on your hard drive. Most of these utilities appear with every version of DOS, even those that Microsoft didn't produce (such as the IBM version). For the most part, these utilities perform maintenance tasks that you could perform in a batch file. For example, many people had batch files for working with the DiskCopy utility when floppy disks were popular. The following sections describe these utilities in detail.
Comparing the Contents of Disks with the DiskComp UtilityYou can use this utility to compare the contents of two floppy disks. Because of the way the utility works, the two floppies must have precisely the same format and you can't compare two newer forms of media, such as CDs. A better alternative for modern media is the FC utility. This utility uses the following syntax:
DISKCOMP [drive1: [drive2:]]
The following list describes each of the command line arguments.
drive1: Specifies the source drive.
drive2: Specifies the destination drive. If you don't specify a destination drive, the utility assumes that you'll use one drive for the comparison and prompts you to replace the source disk with the destination disk as needed.
Copying One Disk to Another with the DiskCopy Utility
You can use this utility to copy the contents of one floppy disk to another floppy disk. Because of the way the utility works, the two floppies must have precisely the same format. A better alternative for modern media is the XCopy utility. This utility uses the following syntax:
DISKCOPY [drive1: [drive2:]] [/V]
The following list describes each of the command line arguments.
drive1: Specifies the source drive.
drive2: Specifies the destination drive. If you don't specify a destination drive, the utility assumes that you'll use one drive for the comparison and prompts you to replace the source disk with the destination disk as needed.
/V Verifies that the files copied correctly. Always use this option to ensure maximum copy reliability.
Modifying Data Files with the Edit Utility
The Edit utility is a very useful application to know about because it works when most other editors don't. The Edit utility is quite small, so you can place it on a floppy if you want or a CD that contains your diagnostic software. In addition, you don't need a graphical interface to use Edit, so it works at the DOS prompt, the Windows recovery console, or just about anywhere else you might need an editor. However, even with these limits, Edit supports a robust interface for a text editor. From a Server Core perspective, however, the Edit utility is best because it has no reliance on Windows functionality, so you don't need to worry about issues such as common dialog box usage.
As you can see, the utility sports many of the same features as Notepad, but without the Notepad requirements. This utility uses the following syntax:
EDIT [/B] [/H] [/R] [/S] [/<nnn>] [/?] [file(s)]
The following list describes each of the command line arguments.
/B Sets Edit to start in monochrome mode.
/H Sets Edit to start with the maximum number of lines of text for your hardware. The default setup displays 25 lines of text.
/R Loads files in read-only mode. Use this option when you want to view the file content without accidentally changing it.
/S Forces Edit to use short filenames.
/nnn Loads a binary file and displays the content by wrapping any long lines to the specified number of characters.
file Specifies the name of the file to load. You can use wildcard characters and multiple file specifications to load multiple files. This argument must appear as the last argument on the command line.
In this tutorial:
- CMD and BAT Files
- Starting the Command Interpreter
- Using the CMD Switches
- Working with the Command Interpreter in the Registry
- Modifying Config.NT
- Displaying the Config.NT Commands
- Modifying AutoExec.NT
- Saving Memory Using the LH Command
- Defining Application Compatibility with the SetVer Utility
- Using Common DOS Utilities
- Formatting a Disk with the Format Utility
- Terminating a Session Using the Logoff Utility
- Managing Environment Variables with the Set Command
- Managing Environment Variables with the SetX Utility
- Using Debugging Utilities
- Working at the Command Prompt
- Managing Usernames and Passwords with CmdKey
- Changing Screen Colors with the Color Command
- Obtaining Command Line Help with the Help Utility
- Creating Batch Files
- Using the Choice Command
- Using the For Command
- Using the Goto Command
- Using the Prompt Command
- Using the WaitFor Utility