none
Change compression ratio Using VBS. RRS feed

  • Question

  • Hello I need to script compressing files older than 60 days in specific directories. I am only getting back 9% of the folders I am compressing. Is there a way to change the compression ratio using VBScript if it can be scripted at all? I am looking through the tutorial and not finding much.

    Thank you in advance.


    admin

    Tuesday, August 19, 2014 10:03 PM

Answers

  • Since you don't say, I am going to guess that you are using the shell objects and the CopyHere or MoveHere methods to add to a zip file.

    The answer is, "don't use those methods in a script." They are not designed for automation. You are correct, there is no way to specify the default compression ratio. There is also no error checking.

    One way to work around this limitation is to use a command-line compression tool such as 7-Zip.


    -- Bill Stewart [Bill_Stewart]


    Tuesday, August 19, 2014 10:22 PM
    Moderator

All replies

  • It cannot be done with VBScript without third party tools.


    ¯\_(ツ)_/¯

    Tuesday, August 19, 2014 10:13 PM
  • Since you don't say, I am going to guess that you are using the shell objects and the CopyHere or MoveHere methods to add to a zip file.

    The answer is, "don't use those methods in a script." They are not designed for automation. You are correct, there is no way to specify the default compression ratio. There is also no error checking.

    One way to work around this limitation is to use a command-line compression tool such as 7-Zip.


    -- Bill Stewart [Bill_Stewart]


    Tuesday, August 19, 2014 10:22 PM
    Moderator
  • Thanks Bill and jrv. 

    admin

    Wednesday, August 20, 2014 2:36 PM
  • Thanks Bill and jrv. 

    admin

    You are welcome - try 7zip - it is free,


    ¯\_(ツ)_/¯

    Wednesday, August 20, 2014 2:48 PM
  • You might have noticed that I did a lot of guessing to figure out your actual question. (You are lucky in this case that I seem to have guessed correctly.)

    It is always best to tell enough detail about what you are asking so as to reduce guesswork. If you make others guess a lot, it will take longer to get a useful answer.

    Remember: We don't have access to your network, we cannot read your mind, and we cannot see your screen.

    Ask a better question and you will get a faster and more useful answer. There are tips at the top of this forum that provide some guidance on how to ask better questions.


    -- Bill Stewart [Bill_Stewart]

    Wednesday, August 20, 2014 4:00 PM
    Moderator