Hello,
I've been asked to come up with a way to rename all of the first level folders in a specific location to follow a new naming convention. The folders currently are named like this: test.folder. We need them to be renamed from test.folder to tfolder. We would do this manually, but there are literally 100s of folders that need to be renamed.
I've got this script so far that reads the list of folder names into an array. However, I am having trouble getting the splitting of the values to work. If there are better ways of doing this, please let me know. Also, my expertise level with VBS is near non-existent. I've been piecing together examples from across the web to get this far. Thanks in advance for all your help!!
[code]
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
strFolderName = "C:\Scripts"
Set colSubfolders = objWMIService.ExecQuery _
("Associators of {Win32_Directory.Name='" & strFolderName & "'} " _
& "Where AssocClass = Win32_Subdirectory " _
& "ResultRole = PartComponent")
Wscript.Echo objFolder.Name
Next
[/code]
Thanks!
Dan