- 帖子
- 380
- 积分
- 1159
- 技术
- 28
- 捐助
- 0
- 注册时间
- 2008-8-21
|
[转贴] 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:
Expansion | Attribute | HAT注 | 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 | 临时文件 | --------l | FILE_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 |
|