Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: compact does not work  (Read 3650 times)

0 Members and 1 Guest are viewing this topic.

mbrad

    Topic Starter


    Starter

    compact does not work
    « on: July 08, 2013, 09:49:24 AM »
    Thanks for taking the time to ready my question.

    I want to compact Temp.xlsx using the compact command.

    I'm trying this: compact /c "C:\Users\bmcintyr\Desktop\TEMP\Temp.xlsx"

    The above line is the only line in my .bat file. The .bat file is located on my desktop

    The only thing that happens is that the above line repeats over and over endlessly until I do a Ctrl + c.

    I've searched on line and think I'm doing everythign correctly. Any help would be great.

    Thanks,
    Brad


    Update: I opened a command prompt and pasted the line after the > and it ran... I recevied this message:
    "Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\Users\bmcintyr>compact /c /s "C:\Users\bmcintyr\Desktop\TEMP\Temp.xlsx"

     Compressing files in C:\Users\bmcintyr\Desktop\TEMP\

    Temp.xlsx               12508 :     12288 = 1.0 to 1 [OK]

    1 files within 1 directories were compressed.
    12,508 total bytes of data are stored in 12,288 bytes.
    The compression ratio is 1.0 to 1.

    C:\Users\bmcintyr>"

    So nothing was compressed, and I don't see a second file in the TEMP folder.
    Brad


    [Win 7 SP1, 32 bit]
    « Last Edit: July 08, 2013, 09:59:46 AM by mbrad »

    Salmon Trout

    • Guest
    Re: compact does not work
    « Reply #1 on: July 08, 2013, 10:23:29 AM »
    No compression utility, including the windows Compact utility, can compress files much if they are already compressed. An xlsx file is already compressed - it is a Zip file in disguise. This is why the compacted size is only a tiny bit smaller than before. You actually achieved 220 bytes reduction in file size. That is all you can expect for this type of file. When you run Compact on a file, it compacts the file you named, it does not produce a new file in the same folder.


    « Last Edit: July 08, 2013, 11:16:40 AM by Salmon Trout »

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: compact does not work
    « Reply #2 on: July 09, 2013, 01:23:25 AM »
    The only thing that happens is that the above line repeats over and over endlessly until I do a Ctrl + c.

    You called the batch file compact.  The batch file ran, looked for a filename called compact and found it in the current folder, so ran your bat again, and again, and again...

    It's a trap we all fall into at some time.