I use the following script to lowercase names from folders. The script works fine. It produces an error (Permission Denied) however if I have a file opened which stands in a to be renamed directory. Is there a way to prevent this error from occurring? Any help, suggestions (even for the script I use) is welcome!
Code:
Dim fso
Dim fol
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set fol = fso.GetFolder(".")
For each oSubFolder In fol.SubFolders
If oSubFolder.Name <> UCase(oSubFolder.Name) Then
oSubfolder.Move UCase(oSubfolder.Name)
End If
Next