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?
+ Reply to Thread
Results 1 to 7 of 7
-
-
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"
) -
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. -
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"
Code:MMCL --unpack %1 %2 IF EXIST %2 ( del %1 ) ELSE ( ren %1 %2 )
-
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"))
-
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.
Similar Threads
-
ISO file bigger than original video_ts file.
By bbanderic in forum DVD RippingReplies: 8Last Post: 20th Feb 2010, 19:04 -
Batch file that can delete a specific file
By Dark_Raven in forum ProgrammingReplies: 1Last Post: 10th Jun 2008, 08:16 -
mpeg4 modifier application error
By fundaris in forum Newbie / General discussionsReplies: 3Last Post: 23rd Feb 2008, 07:59 -
Help with MPEG Modifier... Packed Bitstream...
By GangstaRap in forum Newbie / General discussionsReplies: 0Last Post: 24th Dec 2007, 12:14 -
MPEG4 Modifier and GSpot for Mac?
By tzikeh in forum DVD & Blu-ray PlayersReplies: 1Last Post: 15th Nov 2007, 23:06