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处理符号链接的属性与符号链接的目标
    不太会翻译,有用到的以后再修改吧。
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值