Stupid Geek Tricks: Randomly Rename Every File in a Directory

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