Stupid Geek Tricks: Randomly Rename Every File in a Directory

By Jason Faulkner on April 1st, 2011

image

Looking to have a little fun with your files or play a clever prank on someone? With a simple batch script you can randomly rename every file in a directory instantly.

Update: An “undo” function has been added to the script. There are comments in the batch script which explain how to use this.

Just copy our RandomNames.bat script into a folder and run it.

Before:

image

After:

image

Uses

While it may not be immediately obvious, there are several somewhat practical uses for this:

  • Easily bulk rename picture files to randomize the order they appear in slideshows or on digital picture frames.
  • A practical joke (see the warning below).
  • In case the “random” button on your MP3 player isn’t geeky enough for you.

Options

There are a couple of options you can configure in the script:

  • Prepend the file names – instead of renaming the entire file, a random string is added to the beginning of each file name.
  • Undo renaming –

You can set these options by opening the RandomNames.bat file in Notepad and editing accordingly. There are comments included to let you know how to set each option.

Warning!

When the script runs, it warns you that deleting the created translation file (__Translation.txt) will prevent you from being able to undo the renaming.

image

Needless to say, it would be a good idea to backup your original files before renaming them all.

Use responsibly and have fun!

Download RandomNames script from How-To Geek

Jason Faulkner is a developer and IT professional who never has a hot cup of coffee far away. Interact with him on Google+

  • Published 04/1/11
More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!