Want to change drive letter of volumes. once the script is run it should show the partitions in pop up box and ask for new drive letters.
Used below code but it is just changing the d to q
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colVolumes = objWMIService.ExecQuery _
("Select * from Win32_Volume Where Name = 'D:\\'")
For Each objVolume in colVolumes
objVolume.DriveLetter = "Q:"
objVolume.Put_
Next
Used below code but it is just changing the d to q
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colVolumes = objWMIService.ExecQuery _
("Select * from Win32_Volume Where Name = 'D:\\'")
For Each objVolume in colVolumes
objVolume.DriveLetter = "Q:"
objVolume.Put_
Next