1.

Solve : Batch File to Rename Filename that contains a % sign?

Answer»

Hi there, I have created a batch file that renames a bunch of files. Some of the filenames that I am TRYING to rename contains the % sign and those don't seem to work. Is there a way to rename the filenames that contain the % sign?

IE: Rename "C:\34%!.DOCX" "34%!.DOC"

Thanks,
PatrickHow did the filenames get percent SIGNS in the first place?

Doubling up each percent sign like this might work-

Code: [Select]Rename "C:\34%%!.DOCX" "34%%!.DOC"

It really is a BAD idea to have "ILLEGAL" characters in file names.
we are using a document management system and it converts the filename to these when documents are saved... All I am trying to do is rename the extension and I don't really have any flexibility in modifying the original filename..

I was HOPING that there was some sort of command that would ignore the % sign as a variable or something.Did you try:

Rename *.docx *.doc
Quote from: pbisaillon on March 03, 2009, 04:01:54 PM

All I am trying to do is rename the extension and I don't really have any flexibility in modifying the original filename..


err... that is what Dias's command does...


Discussion

No Comment Found