View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Renaming Folders

Try something like the following. It renames each folder to begin with "___"
and then renames again to the lower case name. This assumes you have no
folders whose name begins with "___". Change C_FOLDER_NAME to the full name
of the folder whose subfolder are to be renamed.

Const C_FOLDER_NAME = "C:\Test" '<<< CHANGE
Dim FSO As Object
Dim TempName As String
Dim FolderObj As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each FolderObj In FSO.GetFolder(C_FOLDER_NAME).SubFolders
TempName = LCase(FolderObj.Name)
FolderObj.Name = "___" & FolderObj.Name
FolderObj.Name = TempName
Next FolderObj
Set FSO = Nothing


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Dan R." wrote in message
ups.com...
Is there a way to rename all files and folders within a directory to
all lower case letters (while keeping the same name)?

Thanks,
-- Dan