|
When using a computer you almost always have to do something to manage files. There are several DOS commands designed to help you. Erasing FilesFiles you no longer need should be deleted from your disk to make room for more current files. Use the ERASE (DELete) command for this:
or
Be careful, typographic errors in this command can bring disaster! You are allowed to delete all files on a disk with the wildcard * (ERASE *.*), but DOS will question you. Recovery BEFORE writing anything else to disk is possible. An UNDELETE utility started shipping with DOS 5.0. Before that commercial utilities were available. Renaming FilesFor whatever reason, you may need to change the name of a file on your disk. (Usually this is the case when you want to change a backup file to another name in order to return it to active status.) Use this format:
Wildcards are allowed, but can cause trouble if you are not careful. The rename command will give you an error message if NEWNAME exists. Copying FilesThe COPY command is a very powerful command within DOS. With it you can create duplicates of individual files, join several files into one, and even use your computer like a simple typewriter by "copying" from the device named CON: to the device named PRN (inefficient, but OK for short notes). Copying one file to another (copies from filename1 to filename2):
There are other options not shown here. Wildcards are allowed. For example,
Copy can also be used to concatenate (join) several files by using the following form:
The options are the same as the previous version of the copy command. All specified filenames (#1, #2, etc.) will be copied and joined into filename0. If no filename0 is specified, the first source file named will be used. Wildcards are dangerous with this command. Example:
The COPY command can be used to create text files by copying from device CON: to a file. The procedure is outlined in the text of the example below.
XCOPYFor copying multiple files the XCOPY command can be a powerful ally. As its name implies, the command performs extended copies. Its format (with only often-used options) is shown here:
Like the COPY command, XCOPY can take a single drive/path designator in which case files from that destination will be copied into the current directory. Some options:
You can copy an entire hard disk to another disk with a single command:
The contents of drive C: will be copied to drive D: a file at a time, with the subdirectory structure intact. You can use the same technique to back up a hard disk to a removable disk (e.g., Bernoulli or other removable media - don't use floppies). Note the /M option above. When DOS writes a file to the disk it sets an archive bit in the disk directory to indicate the file has been somehow changed (it's possible to write a file and not change it but DOS just assumes changes were made). The /M option for XCOPY can take advantage of this. To proceed: 1) Make a full backup first.
2) On a regular basis use the XCOPY command to perform an incremental backup:
Periodically, in order to purge deleted files from the backup you should start over at #1 above and a clean backup disk. Typing a FileAny text file saved in ASCII character format can be easily seen on your video display. Use the type command:
All characters in the file will be displayed on the screen, including any control characters, sometimes resulting in interesting displays. Any control-I characters found will be interpreted as a tab, and spaces will be added to get the cursor over to the next 8-character boundary; some output may appear as tables. Control-Z will cause output to stop. Attempting to TYPE a .COM or .EXE file will result in garbage on the screen, and should generally be avoided. |
Please use the contact
form for questions or comments about this web site.
Copyright © 2001
Computer Knowledge, All Rights Reserved
Pray the Rosary for peace.