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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question: Rename Folders

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
need to figure out a basic script where one can rename a file folder...

basically, say there were a folder named "empty" at c:/
I need to be able to type into a form "empty" into an old name text field and "MyHappyName" into a new name text field, and then press submit and have it change the name...

i dont need anything special, like being able to view the contents of the directory or being able to select the file folder, just need to be able to do that one little thing. any ideas?
 
Use the FileSytemObject. Get the Folder object for your folder and then provid a newname

Dim objFSO
Dim objFolder
Set objFSO = CreateObject("FileSystemObject")
Set objFolder = objFSO.GetFolder(strFolderName)
objFolder.Name = newname


Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top