• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Pull "compression" attribute?

I am looking for a way to find if this is 'set' on files/folders in a 2k/2k3 environment.

Open to either DOS-style scripting, VBS/WSH scripting...or possibly any alternative that doesn't require 3rd party tools (excluding reskit tools).

I'm working another project right now - so I'm offering points for any expert(s) willing to do my homework for me (no, this isn't actual homework...:P) Haha.

Enoy the points, if you find something...post if you need add'l info, but I think it's self explanatory...
  • 2
1 Solution
Not too sure if this helps you, but try this:

compact [/c] [/u] [/s[:DirName]] [/i] [/f] [/a] [/q] filename [...]
/c     Compresses the specified directory or file.
/u     Uncompresses the specified directory or file.
/s[:\DirName]     applies the action to all subdirectories of the specified directory, or of the current directory if none is specified. If :\DirName is used, the compressed attribute is not altered.
/i     Ignores errors.
/f     Forces the action on a previously failed attempt.
/a     Display files with the Hidden and/or System attribute.
/q     Displays minimal information.
filename     Specifies the file or directory. You can use multiple filenames and wildcards.

Typical output without arguments is:
C:\New Folder>compact

 Listing C:\New Folder\
 New files added to this directory will not be compressed.

     1200 :      1200 = 1.0 to 1   test.txt
     1200 :      1200 = 1.0 to 1 C test_compressed.txt

Of 2 files within 1 directories
1 are compressed and 1 are not compressed.
2,400 total bytes of data are stored in 2,400 bytes.
The compression ratio is 1.0 to 1.

Files/folders that are compressed have a 'C' next to them. With some scripting that could be helpful, I suppose... It depends on what you're trying to do.
sirbountyAuthor Commented:
Looks promising...
I'll do some testing and let you know...
sirbountyAuthor Commented:
Haven't had a chance to check it out yet, but looks like I should be able to make it work.

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now