![](https://csdnimg.cn/release/download_crawler_static/88448025/bg13.jpg)
The following CONFIG.SYS command specifies that COMMAND.COM is located in the DOS directory on drive
C:
shell=c:\dos\command.com c:\dos\ /e:1024
This command directs MS-DOS to set the COMSPEC environment variable to C:\DOS\COMMAND.COM. This
command also creates an environment of 1024 bytes for this command interpreter.
Related Command
The shell command is the preferred method of using command to permanently increase space for the
environment table.
Copy
Copies one or more files to the location you specify.
This command can also be used to combine files. When more than one file is copied, MS-DOS displays each
filename as the file is copied.
Syntax
copy [/a|/b] source [/a|/b] [+ source [/a|/b] [+ ...]][destination [/a|/b]] [/v]
Parameters
source
Specifies the location and name of a file or set of files from which you want to copy. Source can
consist of a drive letter and colon, a directory name, a filename, or a combination.
destination
Specifies the location and name of a file or set of files to which you want to copy. Destination can
consist of a drive letter and colon, a directory name, a filename, or a combination.
Switches
/a
Indicates an ASCII text file. When the /a switch precedes the list of filenames on the command line, it
applies to all files whose names follow the /a switch, until copy encounters a /b switch, in which case the /b
switch applies to the file whose name precedes the /b switch.
When the /a switch follows a filename, it applies to the file whose name precedes the /a switch and
to all files whose names follow the /a switch, until copy encounters a /b switch, in which case the /b switch
applies to the file whose name precedes the /b switch.
An ASCII text file can use an end-of-file character (
CTRL+Z
) to indicate the end of the file. When
combining files, copy treats files as ASCII text files by default.
/b
Indicates a binary file. When the /b switch precedes the list of filenames on the command line, it
applies to all files whose names follow the /b switch, until copy encounters an /a switch, in which case
the /a switch applies to the file whose name precedes the /a switch.
When the /b switch follows a filename, it applies to the file whose name precedes the /b switch and
to all files whose names follow the /b switch, until copy encounters an /a switch, in which case the /a
switch applies to the file whose name precedes the /a switch.
The /b switch specifies that the command interpreter is to read the number of bytes specified by the
file size in the directory. The /b switch is the default value for copy unless copy is combining files.
/v
Verifies that new files are written correctly.
Notes
Copying to and from devices
You can substitute a device name for one or more occurrences of source or for destination.
Using or omitting the /b switch when copying to a device
When destination is a device (for example, COM1 or LPT1), the /b switch causes MS-DOS to copy data to the
device in binary mode. In binary mode, all characters (including such special characters as
CTRL+C
,
CTRL+S
,
CTRL+Z
, and carriage return) are copied to the device as data. Whereas, omission of the /b switch causes
MS-DOS to copy data to the device in ASCII mode. In ASCII mode, such special characters as those
previously listed may cause MS-DOS to take special action during the copying process.
Using the default destination file
If you do not specify a destination file, MS-DOS creates a copy with the same name, creation date, and
creation time as the original file, placing the new copy in the current directory on the current drive. If the
source file is on the current drive and in the current directory and you do not specify a different drive or
directory for the destination file, the copy command stops and MS-DOS displays the following error message:
File cannot be copied onto itself
0 File(s) copied