Compress Directory Attribute
Question:
How does one set the Compress attribute on an NT 4.0 directory/folder?
Answer:
The FileAttrSetEX has a flag 2048, but apparently it doesn't compress anything. Per the MSDN Win32 Platform SDK docs, that flag
bit only reports whether or not the folder or file is currently in a compressed state. It doesn't actually trigger a file to
become compressed simply by enabling that bit. Hence the (*) note on that flag in the FileAttrSetEx documentation....
* The values with an asterisk next to them cannot be set using FileAttrSetEx.
More:
You can't set the attribute of a file or folder to compress it...however, in WMI, the Win32_Directory object includes a method
called Compress() that allows the contents of a folder to be compressed in the same way as can be done by using the Windows
graphical user interface.
Win32_Directory
Article ID: W16452
File Created: 2005:02:25:08:52:48
Last Updated: 2005:02:25:08:52:48