Pull "compression" attribute?

Posted on 2004-11-04
Last Modified: 2010-08-05
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 if you need add'l info, but I think it's self explanatory...
Question by:sirbounty
    LVL 2

    Accepted 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.
    LVL 67

    Author Comment

    Looks promising...
    I'll do some testing and let you know...
    LVL 67

    Author Comment

    Haven't had a chance to check it out yet, but looks like I should be able to make it work.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now