![]() |
Batch File to compress multiple file types
I had an old batch file that used winzip that I am trying to convert over to use PACL.
What it should do: Pulls all of the listed types of media files from a CD, including all subdirectories and preserving pathnames. Creates a .zip archive of all of them and outputs a log file. The batch file takes 2 arguments: the name of the archive to create and the letter of the CD-Drive that has the CD in it. When I run the Batch file as "makepzip ta0000 e" this is the output from the log: Archive: d:\ta0000.zip preparing to compress... *** WARNING: Nothing to add or update... All OK So, it looks like either it is not going into all the subdirectories on the CD, or it is only checking the first filetype (jpg), because I know that there are .gif files in some of the directories. Here are the commands in my Batch file: @ECHO OFF ECHO ** This batch file will find all Media Files on %2 and create a zip ** ECHO ** file called d:\%1.zip and d:\%1.log ** "c:\apps\PACOMP" -a -r -P d:\%1.zip %2:\*.jpg %2:\*.bmp %2:\*.gif %2:\*.jpeg %2:\*.tif %2:\*.tiff %2:\*.mpg %2:\*.mpeg %2:\*.mov %2:\*.rm %2:\*.ram %2:\*.asf %2:\*.wmv %2:\*.mpe %2:\*.avi %2:\*.jfif %2:\*.jif %2:\*.art %2:\*.jpe %2:\*.png %2:\*.vob %2:\*.3gp %2:\*.mpa %2:\*.tmp %2:\*.3g2 %2:\*.asx %2:\*.flv %2:\*.shs %2:\*.m2v %2:\*.mod %2:\*.cjp %2:\*.divx %2:\*.wm %2:\*.dv %2:\*.mp4 > d:\%1.log Any help you can give me would be greatly appreciated. Thanks! Dustin |
Two thoughts - but not much help, I'm afraid.
a) I believe there is a 255 char limit on the command b) It appears that the -r command does not work when a filetype is specified (i.e. works only with *.*) Will have to wait for Spwolf or Milli to confirm / deny. P.S. I did a quick test with PACL 6.01 on XP SP3 |
Hmm, didn't think about the character limit, although it does get all the way through the command and create the log file. I am using 6.01 with WinXP SP3 as well.
I guess I could execute a separate command to add each file type to the archive, but I was hoping there was a more efficient way of doing it. |
I did some more testing, using multiple instances of the command, can definitely say that it is not recursing the subdirectories. Anyone see a syntax error in the command I'm using?
"c:\apps\PACOMP" -a -r -P d:\%1.zip %2:\*.inf >> d:\%1.log |
Guess I should add that passing in the arguments and using them in the commands is working fine. There was a .inf file in the root, and it successfully added it to the archive and sent the log to the file.
|
didnt have time yet to look, will do a bit later on, thanks for the patience!
|
Hi spwolf, have you had a chance to look at this issue yet?
Thanks! |
i have an feeling recurse subfolder option does not work unless it gets *.*, which is where the problem would be then... i have sent it to dev team to investigate.
|
Hmm, ok, thanks!
|
1 Attachment(s)
Hi Dustin!
Quote:
The script is this: Code:
'***********************************************************There are two lines in the script you have to modify for your own enviroment. Change this to your path for PACOMP Code:
Const PACOMP = "C:\Programs\PACL\PACOMP.exe"Code:
aList = Array("png", "jpg", "avi")Kind Regards Micke |
Micke,
When I tried it - I changed the path to PACOMP and the extension array to (jpg, png, txt). Each "expected" command line was echoed, but no archive file was created :confused: Then I tried full path ( c:\multypes.zip ) for "my archive" but other than that my script understanding is very limited. What did I miss? |
Quote:
Quote:
Kind Regards Micke |
Quote:
Try to change the archive name from c:\multypes.zip to c:\temp\multypes.zip Kind Regards Micke |
1 Attachment(s)
Quote:
Quote:
Quote:
The c:\temp folder is empty. Thanks for getting back so quick. P.S. I am admin on WinXP SP3 P.P.S. Just thought - should the output path/filename to add be in quotes ?? |
1 Attachment(s)
Hi!
Quote:
Here's the updated script with support for spaces in path or filename. Code:
'*******************************************************************Please let me know the result after you have tested the updated script. Kind Regards Micke |
That's got it.
Well done :cool: |
Thanks, nice to hear that it's working for you now.
Kind Regards Micke |
Wow, thanks for helping out with that script Micke! I'll give it a try.
Thanks, Dustin |
Hi Dustin!
Have you tested the script and if so, is it working correctly for you? Kind Regards Micke |
Yes, your script works. Thanks for all the help!
|
| All times are GMT -5. The time now is 12:47 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.