[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[转贴] Undocummented info of FOR %~a expansion

In FOR commands %%~aI expands %%I to the file attributes of a file.

In the Windows NT family there are at least 14 attributes for files or directories.
FOR's %%~aI only recognizes 9 attributes.

The expansion of attribute of file is a series of 9 dashes.
Each recognized attribute replaces a dash with a letter.

A file without recognized attributes or without attributes is expanded like this: ---------

This is the list of recognized attributes by for command and your expansion:

  
ExpansionAttributeHAT注
d--------FILE_ATTRIBUTE_DIRECTORY目录
-r-------FILE_ATTRIBUTE_READONLY只读文件
--a------FILE_ATTRIBUTE_ARCHIVE归档文件
---h-----FILE_ATTRIBUTE_HIDDEN隐藏文件
----s----FILE_ATTRIBUTE_SYSTEM系统文件
-----c---FILE_ATTRIBUTE_COMPRESSED压缩文件
------o--FILE_ATTRIBUTE_OFFLINE离线文件
-------t-FILE_ATTRIBUTE_TEMPORARY临时文件
--------lFILE_ATTRIBUTE_REPARSE_POINT重新分析点

This is a list of not recognized attributes by for command:

FILE_ATTRIBUTE_NORMAL
FILE_ATTRIBUTE_ENCRYPTED
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
FILE_ATTRIBUTE_SPARSE_FILE

Note:         FILE_ATTRIBUTE_NORMAL is the same as a file without attributes.
Example:         Expansion of a file with attributes hidden and system is: ---hs----

转自:http://www.robvanderwoude.com/ntforfileattributes.php
参考:http://msdn.microsoft.com/zh-cn/library/system.io.fileattributes%28v=vs.80%29.aspx

返回列表