Click here to Skip to main content
15,895,462 members
Articles / Programming Languages / C#
Article

Mass Renamer

Rate me:
Please Sign up or sign in to vote.
2.47/5 (6 votes)
25 May 2007CPOL1 min read 29.1K   356   22   2
A quick example of how to batch-

Screenshot - RenamerRun.png

Introduction

This code will recurse all files in a given folder and rename them based on the rules you fill out on the UI form. I wrote it because I was tired of people trying to get me to pay for a utility that did the same thing. It occurs to me that others may like to look at it or just use it. Either way, I need to give something back. This project is a complete working utility, although you could extend it and shore it up some.

Using the code

Using the code should be extremely easy, especially since it's scoped internal static. You don't even need to instantiate the core object. Simply begin to assign the properties of the object to set behaviors:

//
//  FileRecurser.REPLACE_TEXT_1_FLAG = true;
//  FileRecurser.FIND_TEXT_1         = txtFindText.Text;
//  FileRecurser.REPLACE_TEXT_1      = txtReplaceText.Text;         
//            

Once you have everything set, simply fire up the only method: RenameFiles.

//  
//  fire it up
//  FileRecurser.ReNameFiles(txtFOLDER.Text);
//

Points of interest

This is a very simple project. It's the kind of thing you say you are going to do everyday, but then never get around to it. It was inspired and written in a few hours; I have no doubt that it will be of use to someone out there. Keep posting!

History

  • 25 May, 2007 - This is version 1.0: Buyer beware! Use at your own Risk!!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Consultant
United States United States
I have had a long and varied career...Today I program computers... someday, I hope to graduate to something much more respectable.

Comments and Discussions

 
GeneralGreat little tool (new feature) Pin
duffy2485-Jun-07 0:25
duffy2485-Jun-07 0:25 
GeneralRe: Great little tool (new feature) Pin
DumpsterJuice8-Jun-07 1:08
DumpsterJuice8-Jun-07 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.