VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. I use the command line version of MPEG4 Modifier to get rid of packed bitstream in my Xvid files. When I run this batch file it checks all the files in the folder and creates a new unpacked file in the same folder with same name as the original with unpacked appended to the end.

    @ECHO OFF
    FOR %%I IN (*.avi) DO "C:\Program Files\MPEG4 ModifierCommand\mmcl.exe" --unpack "%%~fI" "%%~nIunpack%%~xI"

    This works fine, but I'd like to be able to automatically delete the original packed file since I no longer have any need of it. Is there a way to change the batch file so it would do this?
    Quote Quote  
  2. Why don't you just use the DEL command to delete the original AVI file?

    @ECHO OFF
    FOR %%I IN (*.avi) DO (
    "G:\Program Files\MPEG4 ModifierCommand\mmcl.exe" --unpack "%%~fI" "%%~nI.unpack%%~xI"
    DEL "%%~fI"
    )
    Quote Quote  
  3. Interestingly that syntax instantaneously deletes the file before it even loads.

    Also I didn't make it clear that I only want to delete the original file if it was packed and a new unpacked file was created. If the original file is already unpacked a new file would not be created and I would want to keep the original.

    Of course deleting a file manually is no big deal, but it seemed like a feature that quite a few people might want so I thought it might be possible. I did google for this a while back Someone asked about this on another site's forum. but no one replied.
    Quote Quote  
  4. I don't have the program so I wasn't able to test the script. You could use IF EXISTS to verify the new file was created but it sounds like MMCL is detaching from the console so you won't be able to do that.

    I just downloaded version 1.4.4 of MMCL and it didn't detach from the console. I came up with the following pair of batch files:

    UNPACK.BAT:
    Code:
    FOR %%I IN (*.avi) DO unpack1 "%%~fI" "%%~nI.unpack%%~xI"
    UNPACK1.BAT:
    Code:
    MMCL --unpack %1 %2
    IF EXIST %2 (
    del %1
    ) ELSE (
    ren %1 %2
    )
    If the file is already unpacked it is simply renamed. Obviously, you don't have to do that if you don't want.
    Quote Quote  
  5. Thanks. I'll give this a try when I get home from work tonight.
    Quote Quote  
  6. Using your example batch files as a guide, i was able to create exactly what I wanted. This batch file deletes the original if the unpacked file was created, and appends all avi's with "pbcheck" to indicate that all them have been checked for packed bitstream. Thanks Again.

    Code:
    FOR %%I IN (*.avi) DO ("C:\Program Files\MPEG4 ModifierCommand\mmcl.exe" --unpack "%%~fI" "%%~nIpbcheck%%~xI" 
    IF EXIST "%%~nIpbcheck%%~xI" (del "%%~fI") ELSE (ren "%%~fI" "%%~nIpbcheck%%~xI"))
    Quote Quote  
  7. Weird, I originally tried to do it all in one batch file like that but it wouldn't work. Maybe I misplaced a parenthesis or something.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!