posted under category: dotnet on December 25, 2005 by Nathan
So, happy holidays all. Given a little extra time this morning, waiting for the in-laws to come back from shopping, I felt the need to rename some files. Ok, a lot of files. All of us CF guys can attest to the ease of getting it done in our favorite tag-based language, but what about running it without having to start 3 services on my local machine? That's where knowing a 2nd language fits in.
So, with an effort to (a) play with visual studio 2005, (b) test drive .NET 2.0, and (c) actually make something useful, I present to you the Regex Mass File Renamer. Install the .NET 2.0 runtime, it came out a couple months ago, download my app, and run the exe in the build folder.
It's not fancy, it's not all that great, but it's what I do in my spare time to make life just a little easier for myself. Choose a folder, enter a regular expression in the 2nd box, and something to replace it with in the 3rd, then hit start and it will change the filename (sans extension) of any files in the chosen folder.
The zip file is my whole project folder from VS2005, so if you have Visual Studio '05, even the free (for a year) express version, you can open the project and play with the source.
Disclaimer: I won't claim to be any sort of OOP expert or great winforms programmer. The code may suck beyond belief. In fact, I'd like to know if it does. Use at your own risk. Make a backup of any files you plan on working with. The source is provided so that I cannot be held responsible with how the program works, or for anything that happens when running it.