Question : Seeking: Command Line Rename Utility with Recursive ability over network

I realize that this may not be considered a networking question, however, considering what I am asking is for a server, I felt it best to post this here.  Besides, being an admin myself, I know that we collect the coolest utilities around for just such an occassion.  Here goes.

I have a single directory.  Under that directory are about 40 directories that are designated by the name of the user they belong to.  Under their directories, there are directories named based on a project they are working on.  There can be hundreds of these directories at any moment.  Inside every one of these directories is another directory followed by several files.  Those files are named without an extension, and they are all named the same.  Example:
M:\instruments\ju\kp12-323\data.fid\fid <--------filename, not directory
M:\instruments\re\kt0005-rf4\data.fid\fid <-----filename
M:\instruments\re\kt5-3342-5\other.fid\fid <-------filename

Now, what I am looking to do is search from the INSTRUMENTS directory, down, and add an extension to every 'fid' file.  I can do this easily with various utilities.  Once.  The problem I have is that new directories and and files are created throughout the day, so I would like to have a command line utility that can do this every 15-20 minutes.

I have looked around, and it is surprisingly difficult to find a command line renaming program that can be dropped onto a Win2003 server, and have it scheduled to run regularly across the network to a SnapServer mapped drive.  I have seen a couple of things that MAY work (XALL, GREN) but I am a bit reluctant to try XALL on my server considering it is incredibly old (1990) and GREN just seems unnecessarily confusing.  I may have to lean toward GREN if you guys don't know of anything else, though.

Basically, all I need is something with a /s switch on the REN command!  If only "REN fid fid.mrc /s" would work! Doh!

So, any cool command line methods of achieving this on a regular basis that you guys know of?

Answer : Seeking: Command Line Rename Utility with Recursive ability over network

There may be a better way but I would create a script using a program called autohotkey (www.autohotkey.com).

The following autohotkey script should do what you request but back up any data before you test it or test it on non-essential data. I have done limited testing.

Install autohotkey (from the above link) and save the folowing to a new text document. Call the text document something like TestRename.ahk



;-------------------------------
;Set options here

;Minutes to repeat
minutes=20

;Set Directory to Search
Directory = C:\instruments

;Recurse SubFolders
recurse=1

;--------Renames files-------

milliseconds:= minutes*60000

Loop
{
  Loop, %Directory%\*.*, 0, %recurse%
  {
    if A_LoopFileName = fid
      FileMove, %A_LoopFileDir%\%A_LoopFileName%, %A_LoopFileDir%\%A_LoopFileName%.mrc
  }

  sleep, %milliseconds%
}
;----------------------------

Random Solutions  
 
programming4us programming4us