WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Zip

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Rename Files in Zip

 Keywords: .Zip rename files inside within 

Question:

I'm looking for a command line tool that can rename files within a zip archive without doing a full unzip, rename, and zip. WinRAR can do it with it's "rn" command line option, but I'd like to find a program that does not need to be installed and is preferably free. Any suggestions?

P.S. How do I know WinRAR's rn command is not just doing an unzip, rename, and zip? Well, because I tested with a large archive that takes 2 minutes to unzip and zip, whereas the rename took only 14 seconds.

Answer:

Likely not the answer you are looking for and not something I have tried with WinBatch but you could load the zip file into a binary buffer and try hacking away at the internal structure. I haven't checked either source but a Google code search might turn up a few c examples or there may even be a zip file content manipulation example in the Tech Data Base someplace.

Or another option would be to call a COM server that supports this type of operation. We happened to stumble across this free Activex dll that supports a 'move' method for changing file names in a zip file

http://xstandard.com/en/documentation/xzip/

Xstandard has been known to produce usable COM scripting components.

objZip = ObjectCreate("XStandard.Zip")
objZip.Move( "eula.txt", "license.txt", "C:\ReInstalls\XStandard\x-zip.zip")
objZip = 0

User Reply:

Cool. I just tried it (had to download and register xzip.dll of course). It worked great.
Article ID:   W17461
File Created: 2008:04:10:15:10:50
Last Updated: 2008:04:10:15:10:50