Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server 2003 Command line help

Status
Not open for further replies.

blmorris

Technical User
May 17, 2007
2
US
Hey folks.

I need to rename (append 4 characters) to about 300 folders within one directory on a windows 2003 server.

I have found several utilities that will do this, but I am wondering if there is a native command line utility that will do this.

I have looked and looked, but can't find anything...

Robocopy doesn't seem to have that function or I would just copy them all to a subfolder with the new name, delete the sources, and then copy the new ones back.

REN doesn't seem to have the switch for that function either.

Let me know if any of you know of a way...

Thanks!
 
Also you may be able to get a VB Script to do the job.
Wayne

Life is a big Roleplaying adventure.

Wayne
 
Hey guys... I found a little script that you can pop into a .cmd or .bat file that will do the job.

Here it is in case you need it in the future.

----------------
@echo off

@rem This bat file appends a suffix to all of the
@rem subdirectories inside of the CURRENT directory

@rem To change the suffix, change the value on the set line
@rem to:
@rem set SUFFIX={value}

setLocal

set SUFFIX=_SAV

@rem -- For each directory contained in the current directory,
@rem -- rename the subfolder by appending the SUFFIX to the
@rem -- existing name

for /D %%i in (*) do ren "%%i" "%%i%SUFFIX%"

endLocal
@echo done

---------------------------

Thanks!



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top