Jump to content

Batch-Renaming Software for files into zip


eXoRt

Recommended Posts

Hi everyone,

I work in a compagny as the IT ressource person, my coworkers asked me for a software that could batch rename the file names into a .zip. I found tons of software that batch rename all types of files but not within .zip archives !

Any help would be good

Thanks,

eXoRt

Link to comment
Share on other sites


jv16 PowerTools 2008 can do that. You can check it out for yourself here. It will install as a trial version.

If you go under the "File Tools" tab and click on "File Tool", you can then search for all the files. you want to change. Under "More functions", choose the "Rename..." option.

It also does about 50 million other useful things, such as registry cleaning, registry compressiong, etc...

Edited by radigast
Link to comment
Share on other sites

7ZIP can be used in a batch file to archive files to .zip. It is freeware. Here is a very simple example of how to archive all files in the directory to .zip.

@echo off
for %%i in (*.*) do "C:\Program Files\7-Zip\7z.exe" a -tzip %%i.zip %%i -r

this is a very simple example and will even archive the batch file since it has to be in the directory it is searching.

Link to comment
Share on other sites

Welcome to MSFN eXoRt :) It sounds to me like you want to rename files within a zip archive, not create new zip archives. I know this can be done by batch extracting/renaming/archiving but there may be a more direct solution.

Link to comment
Share on other sites

Welcome to MSFN eXoRt :) It sounds to me like you want to rename files within a zip archive, not create new zip archives. I know this can be done by batch extracting/renaming/archiving but there may be a more direct solution.

It's exactly what I want to do. batch extracting the files and archving them back again is not an option. They need to do that on about 600 zip files that contain 200 files each.

Link to comment
Share on other sites

So far:

Rename files inside of archive. This command is supported for RAR and ZIP formats. The command syntax is:

winrar rn <arcname> <srcname1> <destname1> … <srcnameN> <destnameN>

For example, the following command:

WinRAR rn data.rar readme.txt readme.bak info.txt info.bak

will rename readme.txt to readme.bak and info.txt to info.bak in the archive data.rar.

It is allowed to use wildcards in the source and destination names for simple name transformations like changing file extensions. For example:

WinRAR rn data.rar *.txt *.bak

will rename all *.txt files to *.bak.

WinRAR does not check if the destination file name is already present in the archive, so you need to be careful to avoid duplicated names. It is especially important when using wildcards. Such command is potentially dangerous, because a wrong wildcard may corrupt all archived names.

Then for example you could:

for %%i in (*.zip;*.rar) do "%PROGRAMFILES%\WinRAR\WinRAR.exe" rn %%i *.dat *.txt
Link to comment
Share on other sites

So far:
Rename files inside of archive. This command is supported for RAR and ZIP formats. The command syntax is:

winrar rn <arcname> <srcname1> <destname1> … <srcnameN> <destnameN>

For example, the following command:

WinRAR rn data.rar readme.txt readme.bak info.txt info.bak

will rename readme.txt to readme.bak and info.txt to info.bak in the archive data.rar.

It is allowed to use wildcards in the source and destination names for simple name transformations like changing file extensions. For example:

WinRAR rn data.rar *.txt *.bak

will rename all *.txt files to *.bak.

WinRAR does not check if the destination file name is already present in the archive, so you need to be careful to avoid duplicated names. It is especially important when using wildcards. Such command is potentially dangerous, because a wrong wildcard may corrupt all archived names.

Then for example you could:

for %%i in (*.zip;*.rar) do "%PROGRAMFILES%\WinRAR\WinRAR.exe" rn %%i *.dat *.txt

Great Tip Thanks! But what if I need to find and replace only a couple of characters in the filename. Does winrar has some kind of cvar for that ?

Link to comment
Share on other sites

  • 6 months later...

Hi

I came across this post when trying to google for an answer to my problem. eXort has the same problem I have.

What I need is a program that will search zip files for any .jpg file with the symbol "#" in the file name and remove it without unzipping, renaming and then re-zipping again

i.e. find [*#*.jpg] file within [*.zip] file and remove the "#" symbol.

For example: file#1.jpg into file1.jpg within fileX.zip

I have thousands of zip files which are full of jpg images, some have a "#" symbol in the name, some don't.

Any help guys?

Link to comment
Share on other sites

You won't find an app that does exactly that out of the box, it's too much of a niche market (it's probably like just you two guys out there with that specific need).

You'd have to write a script that lists files inside each zip file, and if any file has the characters you don't want in it, it uses an external app like winrar to rename them one by one. Or "outsource" to someone that will write it for you... If you have that much data to process, and that it's of any importance to you, you shouldn't mind paying someone a few bucks (on a site like rentacoder or whatever) to do it for you, or spending time to learn to use tools to accomplish it.

Just saying, if you want a tool that does that out of the box, you most likely (as in 99.999% sure) won't find one.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...