
每天一文attrib命令微軟官網翻譯對本命令有任何疑問可留言提問!AttribPublished: April 17, 發布:.4.17Updated: April 17, 更新:.4.17Displays, sets, or removes attributes assigned to files or directories. If used without parameters, attrib displays attributes of all files in the current directory.顯示、設置、或移除分配給文件或目錄的屬性。如果不是用參數,attrib顯示所有在當前目錄下文件的屬性。For examples of how to use this command, see Examples.例如如何使用這個命令,看例子Syntax語法________________________________________attrib [{+|-}r] [{+|-}a] [{+|-}s] [{+|-}h] [{+|-}i] [<Drive>:][<Path>][<FileName>] [/s [/d] [/l]]Parameters參數________________________________________ParameterDescription{+|-}rSets (+) or clears (-) the Read-only file attribute.設置(+)或清除(-)文件的只讀屬性。{+|-}aSets (+) or clears (-) the Archive file attribute.設置(+)或清除(-)文件的存檔屬性。{+|-}sSets (+) or clears (-) the System file attribute.設置(+)或清除(-)文件的系統屬性。{+|-}hSets (+) or clears (-) the Hidden file attribute.設置(+)或清除(-)文件的隱藏屬性。{+|-}iSets (+) or clears (-) the Not Content Indexed file attribute.設置(+)或清除(-)無內容索引文件屬性[<Drive>:][<Path>][<FileName>]Specifies the location and name of the directory, file, or group of files for which you want to display or change attributes.You can use the ? and * wildcard characters in the FileName parameter to display or change the attributes for a group of files指定目錄,文件,或一組你想要顯示或改變屬性的文件的位置.你可以使用?和*通配符在文件名字參數中來顯示或者改變一組文件的屬性。/sApplies attrib and any command-line options to matching files in the current directory and all of its subdirectories.將attrib和該命令的選項應用于匹配的當前目錄和所有子目錄。/dApplies attrib and any command-line options to directories.將attrib和該命令的選項應用于目錄文件夾。/lApplies attrib and any command-line options to the Symbolic link, rather than the target of the Symbolic link. 將attrib和該命令的選項應用于/? Displays help at the command prompt. 在命令行提示中顯示幫助信息。Remarks備注________________________________________•You can use wildcard characters (? and *) with the FileName parameter to display or change the attributes for a group of files.你可以在文件名參數中使用通配符來顯示或者改變一組文件的屬性。•If a file has the System (s) or Hidden (h) attribute set, you must clear the attribute before you can change any other attributes for that file. 如果一個文件有系統或隱藏屬性設置,在你改變那個文件其他屬性之前你必須清除那個文件的系統和隱藏屬性。•The Archive attribute (a) marks files that have changed since the last time they were backed up. Note that the xcopycommand uses archive attributes.存檔屬性標記最近一次備份之后改變過的文件。注意xcopy命令使用存檔屬性。Examples例子________________________________________To display the attributes of a file named News86 that is located in the current directory, type:為了顯示位于當前目錄中的文件名為News86文件的屬性,輸入:attrib news86 To assign the Read-only attribute to the file named Report.txt, type:為了給名字叫Report.txt的文件標記只讀屬性,輸入:attrib +r report.txt To remove the Read-only attribute from files in the Public directory and its subdirectories on a disk in drive B, type:為了給磁盤中B驅動器上的 Public目錄中的文件和他的子目錄移除只讀屬性,輸入:attrib -r b:public*.* /s To set the Archive attribute for all files on drive A, and then clear the Archive attribute for files with the .bak extension, type:為了給A驅動器除了.bak為擴展名的所有文件設置存檔屬性,輸入:attrib +a a:*.* & attrib -a a:*.bak

