Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
olaf2022
Feb 19, 2003
Fun Shoe
I had a need to generate random filenames in Windows (while keeping the original extensions) for a folder with a few thousand files in it.

I found this batch file which worked out pretty well and even keeps a translation log to reverse the process, but it doesn't work with files that contain special characters (i.e. parenthesis, exclamation points, brackets or special unicode characters).

Anyone know of a better way, or how to modify this batch file so that it will work with files containing special characters? TIA.

Adbot
ADBOT LOVES YOU

Deadclown
Aug 1, 2014

Try Ken Rename.

http://lifehacker.com/5074500/ken-rename-helps-you-rename-on-the-go

I used it a while back for something similar and it worked for me.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me
If you have PowerShell, you can generate GUIDs to create random filenames that don't need to be checked to see if they exist ahead of time (very random & well distributed). Will probably need something beyond batch files to handle the special characters though.

FOR /F %a IN ('POWERSHELL -COMMAND "$([guid]::NewGuid().ToString())"') DO ( SET NEWGUID=%a )

  • Locked thread