Batch file script to remove special characters from filenames (Windows)
Posted
by njreed.myopenid.com
on Stack Overflow
See other posts from Stack Overflow
or by njreed.myopenid.com
Published on 2008-11-04T10:54:46Z
Indexed on
2010/03/12
17:17 UTC
Read the original article
Hit count: 573
I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.doc would be renamed to St_rung_20.doc
In order of preference:
- A DOS batch file
- A Windows script file to run with cscript (vbs)
- A third party piece of software that can be run from the command-line (i.e. no user interaction required)
- Another language script file, for which I'd have to install an additional script engine
Background: I'm trying to encrypt these file with GnuPG on Windows but it doesn't seem to handle special characters in filenames with the --encrypt-files option.
© Stack Overflow or respective owner