📄 commands.txt
字号:
command.
/T:time Backs up only files modified at or after the specified time.
The time format depends on the setting you are using for the COUNTRY
command.
/L[:[drive:][path]logfile]
Creates a log file and adds an entry to that file to record the
backup operation. If you do not specify a location for the log file,
BACKUP puts the file in the root directory of the source drive. If
you do not specify logfile, BACKUP names the file BACKUP.LOG. You
should not specify a removable drive (such as a floppy disk drive)
for this parameter; but once the backup is complete, you can copy the
log file to a floppy disk.
NOTES
-----
Backing up onto a disk with files
---------------------------------
Unless you use the /A switch, BACKUP deletes old files (including
read-only files) from a backup disk before adding new files to it.
Backup log file
---------------
If you use the /L switch and do not specify a name and location for
the log file, the BACKUP command adds a file named BACKUP.LOG to the
root directory of the source drive. If the BACKUP.LOG file already
exists, BACKUP adds the current entry to the file. A backup log-file
entry uses the following format:
o The date and time of the backup appear on the first line.
o Each filename appears on a separate line with the number of
the backup disk that contains the file.
The backup log file can assist you later, when you need to identify
the files you want to restore. The RESTORE command always returns a
file to the original directory or subdirectory recorded in the backup
log, creating the subdirectory if necessary.
Labeling backup disks
---------------------
It is important to label and number backup disks consecutively. As each
disk is filled, BACKUP prompts you for the next disk. When you restore
files, you need to insert the backup disks into the disk drive in the
same sequence. To check the sequence of backup disks (MS-DOS version 3.3
or later), use the DIR command to check the disk number.
BACKUP and system files
-----------------------
The BACKUP command cannot back up the system files IO.SYS, MSDOS.SYS,
and COMMAND.COM. You can use the SYS command to copy these files onto
a floppy disk.
Using an old version of the RESTORE command
-------------------------------------------
You cannot use an old version of the RESTORE command (MS-DOS version
3.2 or earlier) for files backed up with MS-DOS version 3.3 or later.
If you attempt this, MS-DOS displays the following message:
Source does not contain backup files
This error occurs because the format of old backup files differs from
the format of files backed up with MS-DOS versions 3.3 and later.
Using BACKUP with networks or redirected drives or directories
--------------------------------------------------------------
If you are sharing files on a network, you can back up only those
files to which you have access. You should not use BACKUP with a drive
that has been redirected with the ASSIGN, JOIN, or SUBST command. If you
do, the RESTORE command may not be able to restore the files.
Backup exit codes
-----------------
The following list shows each exit code and a brief description of its
meaning:
0 The backup was successful.
1 No files were found to back up.
2 Some files were not backed up because of file-sharing conflicts.
3 The user pressed CTRL+C to stop the process.
4 The process stopped because of an error.
You can use the ERRORLEVEL parameter on the IF command line in a
batch program to process exit codes returned by the BACKUP command.
EXAMPLES
--------
Suppose you want to back up all the files in the \PUBLIC\SMITH directory
on drive C onto a blank, formatted disk in drive A. To do so, type the
following:
BACKUP C:\PUBLIC\SMITH\*.* A:
Suppose you need to back up all files in the \PUBLIC\SMITH directory
on drive C onto a 720K floppy disk in drive B. If the floppy disk is
unformatted, BACKUP formats it before backing up any files. Because the
/S switch is not specified in the following command, files in
subdirectories are not backed up:
BACKUP C:\PUBLIC\SMITH\*.* B: /F:720K
To write a simple batch program named SMITH that supports the BACKUP
command's exit codes and the /S switch, you can type the following
commands by using MS-DOS Editor:
echo off
rem Smith's backup command
backup c:\public\smith\*.* b: /s
if errorlevel 4 goto error
if errorlevel 3 goto abort
if errorlevel 2 goto conflict
if errorlevel 1 goto no_files
if errorlevel 0 goto success
:error
echo Backup stopped the process due to an error
goto exit
:abort
echo You just pressed CTRL+C to stop the backup
goto exit
:conflict
echo One or more files were not backed up due to a sharing conflict
goto exit
:no_files
echo Sorry, but there were no files to back up
goto exit
:success
echo The backup was successful
goto exit
:exit
CHOICE----------------------------------------------------------------------
A command used by the Setup program. The CHOICE.COM file is the same one
included with MS-DOS 6.22.
COMP------------------------------------------------------------------------
Compares the contents of two files or sets of files byte by byte.
COMP can compare files on the same drive or on different drives, in
the same directory or in different directories. As COMP compares the
files, it displays their locations and filenames.
SYNTAX
------
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C]
PARAMETERS
----------
data1
Specifies the location and name of the first file or set of files
you want to compare. You can use wildcards (* and ?) to specify
multiple files.
data2
Specifies the location and name of the second file or set of files
you want to compare. You can use wildcards (* and ?) to specify
multiple files.
SWITCHES
--------
/D
Displays differences in decimal format. (The default format is
hexadecimal.)
/A
Displays differences as characters.
/L
Displays the number of the line on which a difference occurs,
instead of displaying the byte offset.
/N=number
Compares the first number of lines of both files, even if the
files are different sizes.
/C
Performs a comparison that is not case-sensitive.
NOTES
-----
Comparing files with the same names
-----------------------------------
The files you want to compare can have the same filename, provided
they are in different directories or on different drives. If you do
not specify a filename for data2, the default filename for data2 is
the same as the filename in data1. You can use wildcards (* and ?)
to specify filenames.
Special cases for data1 and data2
---------------------------------
If you omit necessary components of either data1 or data2 or if you
omit data2, COMP prompts you for the missing information. If data1
contains only a drive letter or a directory name with no filename,
the default filename for data1 is *.*. Therefore, COMP compares all
the files in the specified directory to the file specified in data2.
If data2 contains only a drive letter or a directory name, the
default filename for data2 is the same as that in data1.
How the COMP command identifies mismatching information
-------------------------------------------------------
During the comparison, COMP displays messages to identify the
locations of unequal information in the two files. Each message
indicates the offset memory address of the unequal bytes and the
contents of the bytes themselves (in hexadecimal notation unless
you specify the /A or /D switch). The message has the following
format:
Compare error at OFFSET xxxxxxxx
file1 = xx
file2 = xx
After 10 unequal comparisons, COMP stops comparing the files and
displays the following message:
10 Mismatches
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -