For 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:
XCOPYd1:PATH1 d2:path2 /a /m /s /v
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:
/A Copy only files with archive bit set; do not reset archive bit.
/M Copy only files with archive bit set; reset archive bit.
/S Copy subdirectories as well unless they are empty.
/V Verify copied files as they are written.
You can copy an entire hard disk to another disk with a single command:
XCOPY C: D: /S
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 removabledisk (e.g., Bernoulli
or other removable media - don't use floppies). Note the /M optionabove. 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.
Use the ~ATTRIB~ command to set all archive bits to ON:
C:\>ATTRIB +A *.* /S
Use XCOPY to copy all files and directories, turning all archive bits OFF in the process (assumes
removable media is G:):
C:\>XCOPY C:\ G: /M /S
2) On a regular basis use the XCOPY command to perform an incremental backup:
C:\>XCOPY C:\ G: /M /S
The backup on drive G: will be an image of the file and directory structure on drive C:. The
incremental backup makes certain the image is current.
Periodically, in order to purge deleted files from the backup you should start over at #1
above and a clean backup disk.
Typing a File
Any text file saved in ASCII character format can be easily seen on your video display. Use
the type command:
TYPE d:FILE NAME.ext
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.
implies, the command performs extended copies.
Its format (with only often-used options) is shown here:
XCOPYd1:PATH1 d2:path2 /a /m /s /v
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:
/A Copy only files with archive bit set; do not reset archive bit.
/M Copy only files with archive bit set; reset archive bit.
/S Copy subdirectories as well unless they are empty.
/V Verify copied files as they are written.
You can copy an entire hard disk to another disk with a single command:
XCOPY C: D: /S
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 removabledisk (e.g., Bernoulli
or other removable media - don't use floppies). Note the /M optionabove. 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.
Use the ~ATTRIB~ command to set all archive bits to ON:
C:\>ATTRIB +A *.* /S
Use XCOPY to copy all files and directories, turning all archive bits OFF in the process (assumes
removable media is G:):
C:\>XCOPY C:\ G: /M /S
2) On a regular basis use the XCOPY command to perform an incremental backup:
C:\>XCOPY C:\ G: /M /S
The backup on drive G: will be an image of the file and directory structure on drive C:. The
incremental backup makes certain the image is current.
Periodically, in order to purge deleted files from the backup you should start over at #1
above and a clean backup disk.
Typing a File
Any text file saved in ASCII character format can be easily seen on your video display. Use
the type command:
TYPE d:FILE NAME.ext
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.
No comments:
Post a Comment