4

I have a large collection of files, all in one folder. I don't yet know how large exactly, but I expect it to be in the range of 10,000-100,000. I will eventually be giving them to someone else, but currently the filenames aren't acceptably anonymous. The contents of the files don't need to be changed.

Thus, I need a tool that will allow me to randomly rename every file in the directory. The names should not be based off any data or meta data associated to the files in any obvious way. So, for instance, it would be unacceptable if the new names were based on the dates associated to the files or the current names in any way that would allow one to easily reconstruct any information about the files. The only portion of the extension that should not be changed is the extension.

As for exactly how it will work, I don't particularly care. The new names could be pseudorandomly generated, or they could be given by a sufficiently secure hash. The person I'm giving them to is relatively trustworthy, so security isn't really an issue (they aren't going to be deliberately trying to reconstruct the original names), but it would bring up completely different issues if I sent the files without any attempt to make them anonymous. The new names can be hex strings, or decimal numbers, or even sequential numbers beginning at 1 for some random file and continuing randomly. Anything that doesn't obviously contain any information about the file's contents or meta data is acceptable.

I know that there are a few tools that can do this just from a Google search, but I don't know how well they'd handle a set as big as mine. For the hashing/randomly generating names, it'll need to be able to deal with a substantial number of collisions. For randomly ordering the files, high complexity algorithms to generate a random permutation could be slow. I don't need it to run instantly, but I also don't want to be waiting for days on it to run.

Apart from speed, I'm looking for something relatively lightweight. I don't expect to need to do this more than a couple of times (probably only once). Ideally, it would be something that I can install once, immediately do the operation, and then uninstall it. I don't particularly care about the interface or detailed customization options. Windows is preferred, but I can transfer the files to Linux without too much hassle. A webservice which requires uploading all of the files would not be acceptable, since the average file size will be about 2 MB.

  • 2
    A script for Linux that can do most of the things you want would probably only be a few lines. Probably in Windows the same is possible. I am not sure if you are willing to go down that road? – Bernhard May 8 '14 at 5:49
  • @Bernhard I'd be willing to take that approach if it is truly the simplest. I'm not a programmer though, so it would probably require me several hours to figure everything out. Given that the script posted in this answer breaks on much smaller collections than mine, I'm a bit worried that it might not be as simple as you're claiming. – user2915 May 12 '14 at 4:45
5

RandomNames script by Jason Faulkner:

  • has undo function
  • portable

enter image description here

Direct Download Link.

  • I tested this script out. For 50 files it works fine. For 1000, it gives me numerous "Access Denied" errors and exists after a couple minutes without changing anything. I don't think it was ever intended for use with as many files as I'm using. – user2915 May 12 '14 at 4:42
  • 1
    @user2915 I would say that has nothing to do with the script, as it seems to scale linearly with the amount of filenames, but rather fails because you are trying to rename files that you do not own. – Bernhard May 12 '14 at 5:56
  • This ended up working for me, though only after I moved the files to a different drive. I don't know why it failed, as I've always been the owner of the files. Perhaps my drive has some issues, but in any case this script itself works fine. – user2915 Jul 17 '14 at 1:17
  • Just used it for 380k files in one directory and it worked perfectly. note, it does take time, depending upon your h/w. – Regmi Nov 23 '16 at 1:07
1

Try Advanced Renamer:

  • freeware
  • runs on Windows
  • handles large amount of files
  • verify output before actually renaming

enter image description here

  • 1
    This program only accepts a maximum of 10,000 files at a time, and I expect I may need to rename as many as 100,000. I could potentially run it several times and deal with any naming collisions, but I'd prefer a simpler approach if possible. – user2915 May 12 '14 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.