Windows命令行修改文件屬性

    網上下載個工程,無奈發現工程裏的文件都是隻讀的,然後打開後修改個代碼就要另存爲,所以百度搜索了一下用命令行批量修改,記錄一下。

    網上都是用的 attrib .\*.* -r /s這個,試用了一下,正還可以解決我的問題,介紹一下這個指令。

  如果文件已經打開,不想關閉後執行,再重新打開,可以使用 attrib .\*.* -r /s /d

  官方給出的help如下:

λ attrib /?
Displays or changes file attributes.


ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+P | -P] [+U | -U]
       [drive:][path][filename] [/S [/D]] [/L]


  +   Sets an attribute.
  -   Clears an attribute.
  R   Read-only file attribute.
  A   Archive file attribute.
  S   System file attribute.
  H   Hidden file attribute.
  O   Offline attribute.
  I   Not content indexed file attribute.
  X   No scrub file attribute.
  V   Integrity attribute.
  P   Pinned attribute.
  U   Unpinned attribute.
  [drive:][path][filename]
      Specifies a file or files for attrib to process.
  /S  Processes matching files in the current folder
      and all subfolders.
  /D  Processes folders as well.
  /L  Work on the attributes of the Symbolic Link versus
      the target of the Symbolic Linkj

    簡單翻譯一下:

+添加一種屬性-q清除一種屬性
R只讀屬性A可以存檔文件
S系統文件H隱藏文件
O離線I不允許文件內容索引
XNo scrub file attributeVIntegrity attribute
PPinned attributeUUnpinned attribute

[drive:][path][filename]
指定文件[驅動器][路徑][文件名]/S處理當前文件夾中的文件和所有子文件夾
/Dc處理載入進程的文件夾?/L處理符號鏈接的屬性與符號鏈接的目標
    不太會翻譯,有用到的以後再修改吧。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章