Batch File That Compresses VOB Files (and Deletes Them)?


  1. Posts : 16
    Windows 10 Pro x64, 7 Pro x64
       #1

    Batch File That Compresses VOB Files (and Deletes Them)?


    Having some difficulty in getting a batch file to compress each *.VOB file from a DVD and then deleting the original *.VOB file.

    I'm fairly new to batch file writing, so I don't know much about it at the moment.

    Here is the batch file I've created so far (to the extent of just compressing VOB files, and not deleting the original files yet) -

    FOR %%a IN (*.VOB) DO (7z a -mx9 %%a *.VOB)

    Running this batch gives an error and/or nothing seems to happen!?

    There are approximately 20 VOB files on each DVD, and the batch file is intended to speed up the process of compressing each VOB using 7-zip ('7z' in the batch file, the 'a' means add to 7z archive, '-mx9' means use maximum compression, the following %%a is supposed to be the compressed archive/file name, and the *.VOB is supposed to be input file name).

    Note that I can run 7-zip compression program (by itself) manually via the command line, so the Environment Variables have been set up properly. And by default, 7-zip will, or should, append the extension .7z to each compressed file.

    How do I get this batch file to compress each VOB file?
      My Computer


  2. Posts : 16
    Windows 10 Pro x64, 7 Pro x64
    Thread Starter
       #2

    Figured it out in the end.
      My Computer


  3. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #3

    Hi meeshu,

    meeshu said:
    Figured it out in the end.
    I am glad that you have found a solution to your problem/question. Can you please post the solution so that other people visiting this thread that have the same problem/question can benefit and learn from your experience.
    Thank you!
      My Computer


  4. Posts : 16
    Windows 10 Pro x64, 7 Pro x64
    Thread Starter
       #4

    Correct form should be -

    FOR %%a IN (*.VOB) DO (7z a -mx9 %%a.7z %%a)
      My Computer


  5. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #5

    meeshu said:
    Correct form should be -

    FOR %%a IN (*.VOB) DO (7z a -mx9 %%a.7z %%a)
    Thanks meeshu.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:26.
Find Us