每天一文命令行微軟官網翻譯121115更新由于我權限不夠暫時發在這里了 十分抱歉。對翻譯的質量和準確性 在這里不做任何保證,當然歡迎大家積極指認錯誤!翻譯的準確與否自行辨認。微軟所有命令的解釋官網:http://technet.microsoft.com/en-us/library/cc771080.aspx已經發布的命令:copy、attrib:http://www.bathome.net/viewthread.php?tid=20043&page=1&extra=#pid11del:http://www.bathome.net/thread-20075-1-1.htmlcd:http://www.bathome.net/viewthread.php?tid=9&page=1&extra=#pid120352format:http://www.bathome.net/viewthread.php?tid=1&extra=for:http://www.bathome.net/viewthread.php?tid=6&page=1&extra=#pid120476if:http://www.bathome.net/viewthread.php?tid=4&extra=如對發布的相關命令有任何疑問可以相關帖子下面留言,我會盡力解答!這個疑問包括在使用命令時產生的疑惑或對原文某命令參數不理解等。copy:推出: 4, 17, 更新日期: 4, 17, 應用于: Windows 8, Windows Server 2008, Windows Server , Windows Vista復制一個或多個文件從一個位置到另一個位置。.例如如何使用這個命令查看: Examples.語法________________________________________copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <源文件> [/a | /b] [+<源文件> [/a | /b] [+ ...]] [<目的路徑和文件> [/a | /b]]參數________________________________________參數描述/dAllows the encrypted files being copied to be saved as decrypted files at the destination.允許加密文件被復制保存為解密文件到目標目錄/vVerifies that new files are written correctly. 確認新的文件被正確的寫入。/nUses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters.使用短文件名,如果是合適的。當復制一個文件名超過8個字符,或擴展名超過3個字符的文件時。/ySuppresses prompting to confirm that you want to overwrite an existing destination file.禁止提示符確認你是否想要覆蓋已經存在的目標文件。/-yprompts you to confirm that you want to overwrite an existing destination file.提示你確認是否想要覆蓋已經存的目標文件。/zCopies networked files in restartable mode.在可重新啟動模式中復制網絡文件。/aIndicates an ASCII text file.表示一個ascii文本文件。/bIndicates a binary file.表示一個二進制文件。<Source>Required. Specifies the location from which you want to copy a file or set of files. Source can consist of a drive letter and colon, a directory name, a file name, or a combination of these.需要的,指定你想要復制或設定文件從哪個位置。來源可以由一個磁盤字母和冒號,一個目錄名,一個文件名或以上的組合組成。<Destination>Required. Specifies the location to which you want to copy a file or set of files. Destination can consist of a drive letter and colon, a directory name, a file name, or a combination of these.需要的,指定你想要復制或設置文件到哪個位置。目標可以由一個磁盤字母和冒號,一個目錄名,一個文件名或以上的組合組成。/?Displays help at the command prompt.在命令提示中顯示幫助。Remarks備注________________________________________•You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file. 你可以復制一個ASCII文本文件它使用一個文件結束符(CTRL+Z)來表明文件的末尾。(copy con 0.txt)•Using /a使用 /aWhen /a precedes or follows a list of files on the command line, it applies to all files listed until copy encounters /b. In this case, /b applies to the file preceding /b.在命令行中當/a位在一系列文件之前或之后,他將應用于所有列出的文件直到copy遇到/b,這時,/b應用于/b之前的那個文件。 The effect of /a depends on its position in the command-line string. /a的影響取決于他在命令行字符中的位置。When /a follows Source, copy treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z).當/a跟隨一個源文件,copy命令把這個文件當作ascii文件并且復制文件結束符之前的所有數據。When /a follows Destination, copy adds an end-of-file character (CTRL+Z) as the last character of the file.當/a后跟隨一個目的文件,copy命令會加上一個文件結束符作為這個文件的最后一個字符。•Using /b使用/b/b directs the command interpreter to read the number of bytes specified by the file size in the directory./b is the default value for copy, unless copy combines files. /b引導命令解釋器在目錄中讀取文件字節數的大小。/b是copy的默認值除非copy合并文件。When /b precedes or follows a list of files on the command line, it applies to all listed files until copy encounters /a. In this case, /a applies to the file preceding /a.在命令行中當/b位在一系列文件之前或之后,他應用于所有列出的文件直到copy命令遇到/a,這時,/a應用于/a之前的那個文件。The effect of /b depends on its position in the command–line string. /b的影響取決于他在命令行字符中的位置。When /b follows Source, copy copies the entire file, including any end-of-file character (CTRL+Z).當/b跟隨一個源文件,copy命令會復制整個文件,包括任何文件結束符(ctrl+z)When /b follows Destination, copy does not add an end-of-file character (CTRL+Z). 當/b跟隨一個目標文件,copy命令不會加命令結束符(ctrl+z)。•Using /v使用/vIf a write operation cannot be verified an error message appears. Although recording errors rarely occur with copy, you can use /v to verify that critical data has been correctly recorded. The /v command-line option also slows down the copy command, because each sector recorded on the disk must be checked. 如果寫操作不能被確認會出現錯誤信息。即使記錄錯誤很少在copy命令中發生,你可以用/v來確認關鍵數據已經被正確的記錄。/v命令行選項同時會拖慢copy命令,因為磁盤上每個扇區的記錄都會被檢查。•Using /y and /-y使用/y和/-yIf /y is preset in the COPYCMD environment variable, you can override this setting by using /-y at the command line. By default, you are prompted when you replace this setting, unless the copy command is executed in a batch script.如果/y已經預設值在copycmd的環境變量里,你可以在命令行中通過使用/-y覆蓋這個設置。默認情況下,你重置此設置時系統會提示,除非copy命令正在一個腳本中運行。•Appending files 附加文件To append files, specify a single file for Destination, but multiple files for Source (use wildcard characters orFile1+File2+File3 format).為了附加文件,確認一個單獨文件為目標文件,多個文件為源文件(使用通配符或者文件1+文件2+文件3格式)。•Using /z使用/zIf the connection is lost during the copy phase (for example, if the server going offline breaks the connection), copy /z resumes after the connection is re-established. /z also displays the percentage of the copy operation that is completed for each file.如果在copy階段連接丟失(例如,如果服務器下線中斷了連接),copy /z會在接重新可用時恢復連接。/z也可以顯示每個文件復制的完成百分比。•Copying to and from devices 復制文件到磁盤或從磁盤復制文件You can substitute a device name for one or more occurrences of Source or Destination.你可以把一個或多個出現的源文件或目的文件替換為設備名。 •Using or omitting /b when copying to a device 使用或忽略/b在復制到設備時。When Destination is a device (for example, Com1 or Lpt1), /b copies 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, and ENTER) to the device as data. However, if you omit /b, data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process. 當目標是一個設備時(例如,com1或者lpt1)/b以二進制的模式復制數據到設備。在二進制模式中,copy /b以數據的形式復制所有的字符(包括特殊符號就像ctrl+c,ctrl+s,ctrl+z和enter)到設備。然而,如果你忽略/b,數據以ascii模式復制到設備。在ASCII模式下,在復制過程中特殊字符也許會引起文件的組合。•Using the default destination file 使用默認目的文件If you do not specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored 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 displays the following error message: 如果你不指認目的文件,復本將會創建和原文件相同的名字、修改日期和修改時間。新的副本將會保存在當前磁盤的當前目錄中。如果你不指定一個不同的磁盤或目錄為目的文件。copy命令將會停止并顯示以下的錯誤信息。File cannot be copied onto itself文件無法自我復制0 File(s) copied0個文件被復制•Combining files 合并文件If you specify more than one file in Source, copy combines them all into a single file using the file name specified in Destination. Copy assumes the combined files are ASCII files unless you use the /b option. 如果你指定不止一個文件作為源文件,copy會將所有的文件合并進一個單獨的文件使用指定的目的文件名。Copy命令假設合并的文件是ascii文件除非你使用/b選項。•Copying zero-length files 復制0字節文件Copy does not copy files that are 0 bytes long. Use xcopy to copy these files. Copy命令不復制0字節的文件,使用xcopy來復制這些文件。•Changing the time and date of a 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> +,,The commas indicate the omission of the Destination parameter.逗號表明遺漏的目標文件參數•Copying files in subdirectories在子目錄中復制文件To copy all of a directory's files and subdirectories, use the xcopy command. 為了復制目錄和子目錄中所有的文件,使用xcopy命令。•The copy command, with different parameters, is available from the Recovery Console.帶有不同參數的copy 命令同樣適用于故障恢復控制臺。Examples例子________________________________________To copy a file called Memo.doc to Letter.doc in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type:為了復制一個叫做memo.doc的文件為letter.doc在當前目錄中并且確保文件結束符在復制文件的結尾,輸入:copy memo.doc letter.doc /aTo copy a file named Robin.typ from the current drive and directory to an existing directory named Birds that is located on drive C, type:為了復制一個叫做robin.typ的文件從當前磁盤目錄到一個存在的目錄名字叫birds的c盤的一個目錄,輸入:copy robin.typ c:birdsIf the Birds directory does not exist, the file Robin.typ is copied into a file named Birds that is located in the root directory on the disk in drive C.如果 Birds 目錄不存在,Robin.typ 文件將被復制到驅動器 C 的磁盤根目錄下名為 Birds 的文件中。To combine Mar89.rpt, Apr89.rpt, and May89.rpt, which are located in the current directory, and place them in a file named Report (also in the current directory), type:為了合并mar89.rpt,apr89.rpt,和may89.rpt,位于當前目錄下的三個文件。并且防止他們在一個名字叫做report的文件里(同樣也在當前目錄中),輸入:copy mar89.rpt + apr89.rpt + may89.rpt ReportWhen you combine files, copy marks the destination file with the current date and time. If you omit Destination, the files are combined and stored under the name of the first file in the list. For example, to combine all files in Report when a file named Report already exists, type:當你合并文件時,copy記錄目標文件用當前的日期和時間。如果你忽略目標文件,文件會合并并儲存以列表中第一個文件的名字,例如,為了合并所有文件在report當report文件已經存在的時候,輸入:copy report + mar89.rpt + apr89.rpt + may89.rptTo combine all files in the current directory that have the.txt file name extension into a single file named Combined.doc, type:為了合并所有當前目錄下的txt文件到一個名為combined.doc,輸入copy *.txt Combined.doc If you want to combine several binary files into one file by using wildcard characters, include /b. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type:如果你想要合并幾個二進制文件到一個文件通過使用通配符,插入/b,這將組織windows系統吧ctrl+z當作文件結束符。例如,輸入:copy /b *.exe Combined.exeCaution注意If you combine binary files, the resulting file might be unusable due to internal formatting.如果你合并二進制文件,結果可能導致合并的文件不可用由于內部格式。In the following example, copy combines each file that has a .txt extension with its corresponding .ref file. The result is a file with the same file name but with a .doc extension. Copy combines File1.txt with File1.ref to form File1.doc, and then copy combines File2.txt with File2.ref to form File2.doc, and so on. For example, type:在以下的例子中,copy命令合并了每個txt擴展的文件和與他對應的ref擴展名的文件。結果是生成一個相同的文件名但是以.doc為擴展名。Copy合并1.txt和1.ref組成1.doc,然后copy合并2.txt和2.ref組成2.doc,如此依次執行。例如輸入:copy *.txt + *.ref *.docTo combine all files with the .txt extension, and then combine all files with the .ref extension into one file named Combined.doc, type:為了合并所有的txt擴展文件然后合并所有的ref擴展文件為一個combined.doc文件,輸入:copy *.txt + *.ref Combined.doc這么著其實很亂 我想上傳附件奈何權限不夠。無法上傳 以后有時間再補吧。每天一個命令哦!