Geeks With Blogs


INauseous() Shawn Cicoria - Solution Architect, Craftsman and Artisan - INauseous() - Main Blog Here:

Updated: June 12, 2006 - I had some debug code in there, basically a sleep for a second statement - doh! - I've removed it and Zip file updated

There have been numerous times that I’ve needed the ability to rename a set of files based upon a pattern, something regular expressions could easily take care of if the old DOS rename command, or something built into the Windows OS could do.  However, there’s nothing in Windows base set of command utilities that can provide this.  I haven’t delved into Windows PowerShell (fka Monad) enough to see if this capability exists already.  But, I had a bunch of pictures that I wanted renamed in my library and just needed a utility to do it.

So, I built this utility to help me rename files, by directory, based upon Regular Expression patterns.

A Zip archive of the Solution files are File Rename Utility Zip File solution that contains the following:

  • Visual Studio Solution
  • Windows Installer
  • Program Executable

 The following is a screen shot of the tool after reading a directory and running a trial.

View of Utility

This version doesn’t have batch capabilities.  It does leverage the BackgroundWorker class for handling both the trial and actual renaming of the files so the UI doesn’t block during long processing.  So, that means it can be used on a network directory.  Below is a screen shot of it running against a UNC name.

FileName utility running against UNC name


Shawn Cicoria is a Consultant with Avanade ( the leading Systems Integration Consultancy focused on the Microsoft Platform. Shawn is also a MCT training instructor with SetFocus ( located in Parsippany NJ. Focused on distributed technologies such as COM[+], J2EE, and for the past 5 years .NET, SOAP, BizTalk, and Database technologies -- and now WinFX – err, I mean .NET 3.0.

Posted on Monday, July 10, 2006 11:01 AM | Back to top

Comments on this post: Regular Expression File Renaming Utility

# re: Regular Expression File Renaming Utility
Requesting Gravatar...
If anyone has downloaded this, it has some "debug" code it in. Basically, a sleep for a second (System.Threading.Thread.Sleep( 1000 )).

I've removed it and updated the zip.
Left by Shawn Cicoria on Jul 12, 2006 12:46 PM

# re: Regular Expression File Renaming Utility
Requesting Gravatar...
I used to resort to command line utilities earlier. This is a useful utility for me.
Left by Nishith Prabhakar on Jul 15, 2006 11:44 PM

Comments have been closed on this topic.
Copyright © Shawn Cicoria | Powered by: