I have a hidden file on my USB removable storage (FAT file system).
I'm using Windows 7. If I go to Properties window of this file and then to the Details tab, I will see that the attributes of the file are HX
. When I run cmd
and use attrib
, I was told that file has attribute H. Nothing about X. I've tried help attrib
, but still nothing about attribute X.
I know that:
- H = Hidden
- S = System
- A = Archival
- R = Readonly
However, I have no idea what X stands for. I've also found what the N and E attributes are for.
Wikipedia has no mention of what the X attribute is.
Google found two topics mentioning attribute X:
None of these helped.
I'd like to be able to read/write this flag in C#, but so far I read the documentation for the FileAttributes
enumeration and experimented with setting some of listed attributes (using File.GetAttributes
& File.SetAttributes
methods) on the file.
None of these experiments resulted in attribute X showing up in Properties -> Details. So, I have no idea how to approach it, especially since I still don't know what attribute X means.
So, what is attribute X and how can one set/clear it on the selected file in C#?
chkdsk
. No, I have done thechkdsk
- no problems were found and attribute X is still there. – Sitaint
, and output it in hex. Then compare the set bits to the File Attribute Constants: msdn.microsoft.com/en-us/library/windows/desktop/…. That should tell you which bit is improperly set. If you want to clear the attribute, clear it in that int, cast the int back to aFileAttributes
, and callFile.SetAttributes
. – Stagnate0x20
(archive file), then I set it to0x22
and dummy became hidden. Tried to get attributes of file in question - got0x42
(device+hidden). Tried to set it to0x2
(just hidden), but I got stopped by "Access denied". Then I tried to set dummy's attributes to0x42
. No problems there, however when I check dummy's Details tab, it's only attribute isH
. And if I get dummy's attributes now, it's just0x2
. "0x40
Reserved; do not use". Any other way? – Sita0x40
attribute by other program, I'd like to be able to do the same. Or to set it off. – Sita