In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to use copy in dos to copy one or more files from one location to another location, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Copy
Copy one or more files from one location to another.
Grammar
Copy [/ d] [/ v] [/ n] [{/ y | / y}] [/ z] [{/ a | / b}] Source [{/ a | / b}] [+ Source [{/ a | / b}] [Destination [{/ a | / b}]]
Parameters.
/ d
Allows the copied encrypted file to be saved as a decrypted file at the destination.
/ v
Verify that the new file is written correctly.
/ n
Use a short file name, if any, when copying a file with a name longer than eight characters or a file extension longer than three characters.
/ y
Do not prompt you to confirm that you want to overwrite the existing target file.
/-y
Prompts you to confirm that you want to overwrite the existing target file.
/ z
Copy network files in restart mode.
/ a
Indicates the ASCII text file.
/ b
Indicates the binary file.
Source
You must specify the location of the file or set of files to copy. A source can consist of a drive letter and a colon, a folder name, a file name, or a combination of these.
Destination
You must specify the location to which you want to copy the file or fileset. Destination can consist of drive letters and colons, folder names, file names, and a combination of them.
/?
Displays help at the command prompt.
Annotation
You can copy ASCII text files that use the end of file character (CTRL+Z) to indicate the end of the file.
Use / a
When / a precedes the list of files on the command line, it applies to all listed files until copy encounters / b. In this case, / b is applied to / b in front of the file.
When / a follows the file list on the command line, it applies to all listed files until copy encounters / b. In this case, / b is applied to / b in front of the file.
The function of the / a parameter depends on its position in the command line string. When / a follows Source, copy treats the file as an ASCII (text) file and copies the data before the Terminator of the first file.
When / a follows Destination, copy adds the file Terminator as the last character of the file.
Use / b
/ b specifies that the command interpreter reads the number of bytes specified by the file size in the directory. / b is the default value for copy unless copy is used to merge files.
When / b precedes the file list on the command line, it applies to all listed files until copy encounters / a. In this case, / an is applied to / an in front of the file.
When / b is after the file list on the command line, it applies to all listed files until copy encounters / a. In this case, / an is applied to / an in front of the file.
The role of / b depends on its position in the command line string. When / b follows Source, copy copies the entire file that contains any file Terminator.
When / b follows Destination, copy does not add a file Terminator.
Use / v
If the write operation cannot be verified, an error message appears. Although logging errors are rare with copy, you can still use / v to ensure that important data is recorded correctly. This / v command line option also slows down the copy command because you want to check every sector recorded on the drive.
Use / y and /-y
If / y is pre-set in the COPYCMD environment variable, you can replace this setting by using /-y on the command line. By default, you are prompted when you replace this setting unless the copy command is executed in a batch script.
Ancillary document
To attach files, specify a single file for Destination, but specify multiple files for Source (using wildcards or the format of file 1 + file 2 + file 3).
Use / z
If the connection is lost during the replication phase (for example, if the server is disconnected offline), copy / z will continue to replicate after the connection is re-established. / z also displays the percentage of copy operations completed for each file.
Copy to and from Devic
You can replace source or destination that occurs one or more times with the device name.
Use or omit / b when copying to a device
When destination is a device (for example, Com1 or Lpt1), / b copies the data to the device in binary mode. In binary mode, copy / b copies all characters (including special characters, such as CTRL+C, CTRL+S, CTRL+Z, newline characters, etc.) to the device as data. However, if / b is omitted, the data will be copied to the device in ASCII mode. In ASCII mode, special characters may cause Windows XP to merge files during replication. For more information, see merge Files.
Use the default destination file
If you do not specify the destination file, the copy is created with the same name, creation date, and creation time as the source file, and the new copy is placed in the current directory of the current drive. If the source file is in the current directory of the current drive and you do not specify a different drive or directory for the destination file, the copy command terminates with the following error message:
File cannot be copied onto itself
0 File (s) copied
Merge Fil
If you specify multiple source,copy separated by a plus sign, these files are merged into a single file. If a wildcard character (* or?) is used in source, but a single file name is specified in destination, copy merges all files that match the file name in source and creates a single file using the file name specified in destination. In either case, copy assumes that the merged file is an ASCII file, unless the / b command line option is used.
Copy zero-length files
Copy does not copy files that are 0 bytes long. Use xcopy to copy these files.
Change the time and date of the file
If you want to assign the current time and date to a file without modifying the file, use the following syntax:
Copy / b Source+
A comma indicates that the Destination parameter is omitted.
Copy files in a subdirectory
To copy all the files and subdirectories in the directory, use the xcopy command. For more information about xcopy, see ".
The recovery console provides copy commands with different parameters.
Example
To copy the file Memo.doc to Letter.doc in the current directory and ensure that the file Terminator is at the end of the copied file, type:
Copy memo.doc letter.doc / a
To copy the file Robin.typ from the current directory of the current drive to the existing directory Birds on drive C, type:
Copy robin.typ c:\ birds
If the Birds directory does not exist, the Robin.typ file will be copied to the file named Birds in the disk root of drive C.
To copy several files into one file, you need to list several Source files, with the file names separated by a plus sign (+), and specify the Destination file to include the resulting file of the merge. For example, to merge Mar89.rpt, Apr89.rpt, and May89.rpt in the current directory of the current drive and place them in a file named Report in the current directory of the current drive, type:
Copy mar89.rpt + apr89.rpt + may89.rpt report
When merging files, copy marks the target file with the current date and time. If Destination is omitted, the file is merged and stored with the name of the first specified file. For example, to merge all four files into Report, and there is already a file named Report, type:
Copy report + mar89.rpt + apr89.rpt + may89.rpt
You can also merge several files into one file by using wildcards (* or?). For example, in the current directory of the current drive, to merge all files with the .exe extension into a file named Combin.doc, type:
Copy * .txt combin.doc
If you want to use wildcards to merge several binaries into one file, add the / b command line option. This prevents Windows XP from treating CTRL+Z as a file Terminator. For example, type:
Copy / b * .exe combin.exe
Warning
If you merge binaries, the resulting file may not be available because of the internal format.
In the following example, the copy command merges each file with a .txt extension with its corresponding .ref file. The result is a file with the same file name but a .doc extension. Copy merges File1.txt with File1.ref to form File1.doc, then copy merges File2.txt with File2.ref to form File2.doc, and so on. For example, type:
Copy * .txt + * .ref * .doc
To merge all files with a .txt extension, then merge all files with a .ref extension, and place the merge results in the Combin.doc file, type:
Copy * .txt + * .ref combin.doc
These are all the contents of the article "how to use copy to copy one or more files from one location to another in dos". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.