How about something like this?

 

FOR /R H:\TEST1\ %I IN (WO*.*) DO SCRIPT.VBS %I

 

 

And SCRIPT.VBS looks like this:

 

strSourceFilePath = WScript.Arguments.Item(0) 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set f = objFSO.GetFile(strSourceFilePath)

strTempFileName =f.Name

strTempFileName = Right(strTempFileName, Len(strTempFileName) - 2)

f.Name = strTempFileName

 

 

 

 

Chris Bodnar, MCSE
Sr. Systems Engineer
Infrastructure Service Delivery
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]
Phone: 610-807-6459
Fax: 610-807-6003

  _____  

From: RM [mailto:[email protected]] 
Sent: Friday, January 22, 2010 6:22 AM
To: NT System Admin Issues
Subject: Help with mass file renaming via command-line

 

Hi all,

 

I need to put together a command line to traverse a folder tree and rename
all files that start with "WO" to drop the "WO" but keep the rest of the
name.

 

I think I'll need a FOR /R command but I can't work out all of the rest.
Any experience with this?

 

Thanks!

 

 



-----------------------------------------
This message, and any attachments to it, may contain information
that is privileged, confidential, and exempt from disclosure under
applicable law.  If the reader of this message is not the intended
recipient, you are notified that any use, dissemination,
distribution, copying, or communication of this message is strictly
prohibited.  If you have received this message in error, please
notify the sender immediately by return e-mail and delete the
message and any attachments.  Thank you.
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to