Batch Programs
Batch programs are unformatted text files that contain MS-DOS commands. If you often type the same set of commands to start a program, you can put them into a batch program. Instead of typing the commands each time, you can use the batch program, which carries out the commands for you. Batch files always have a .BAT extension.
File Size, Date and Time
MS-DOS stores information about the size of the files and the date and time they were created or modified. You can view this information by using the dir command. For example, MS-DOS might display the following information in response to a dir command:Volume in drive C is TAMBUNAN
Volume Serial Number is 1893-4Fxx
Directory of c:\
06/11/2009 04:42 AM 24 autoexec.bat
06/11/2009 04:42 AM 10 config.sys
01/13/2013 05:37 PM <DIR> eSupport
07/14/2009 09:37 AM <DIR> PerfLogs
01/21/2013 09:58 PM <DIR> Program Files
01/13/2013 05:18 PM 2,292 RHDSetup.log
07/23/2009 07:29 PM 881 setup.iss
01/14/2013 04:59 PM <DIR> Users
01/20/2013 07:42 AM <DIR> Windows
4 File(s) 3,207 bytes
5 Dir(s) 287,198,117,888 bytes freeNOTE When you use the dir command, the periods that separate filenames and extensions are not displayed in the listing. The name and extensions of the files are separated by spaces. If you use the dir command with the /w switch, however, the periods are displayed. The /w switch is described later in this chapter.
Next to the filename, MS-DOS displays the size of the file. Files are measured in bytes. One byte is the amount of space it takes to store a single character. File size indicates how much disk space is occupied by the file.
To the right of the file size, MS-DOS displays the date and time the file was created or last changed. MS-DOS revises the date and time only when you change the contents of the file. The time and date don't change when you copy the file or rename it.
The size, date and time information can help you keep track of your files. For example, you might want to know whether two files with different filenames contain the same information. One way to determine whether the two files are the same is to look at their sizes, dates and times. If the size and date are the same for both files, it's likely that their contents are identical. If you are to be sure that two files are the same, use the fc command.
When you are backing up files, you often have two or more files with the same filename in different directories or on different disks. You can use file size and date to determine which file is the most recent.
Using Wildcards
If you want to perform the same task for a group of files, you don't have to use the same command repeatedly for each filename in the group. You can use wildcards to specify groups of files. A wildcard acts as a substitute for a name or extension.There are two wildcards:
- The asterisk (*) represents a whole word or a group of characters.
- The question mark (?) represents a single character.
Keyword: Learning MS-DOS | The Complete MS-DOS Commands | MS-DOS tutorial | MS-DOS Script
Tumpal Tambunan
|
You may also like: