Hi,
I'm having problems with some USB drives, I need to set up 5 USB drives for our backup.
I need them to all be drive letter F:, 4 drives when unplugged and plugged back in re-assign correctly, as they are identical USB drives.
However western digital seem incapable of sending us the right drive and we have one that is 320gb instead of 250gb.
I decided to try to write a script which would disconnect any drive using letter F: and reassign it, but I'm having trouble...
here is my script
I'm not getting any errors, but it's not working either.
I have found when going into disk management and manualy assigning the drive letter, the volume name keeps being changed from 'Monday' to 'Local Disk', why is this happening?
can anyone advise how I resolve this issue?
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts
I'm having problems with some USB drives, I need to set up 5 USB drives for our backup.
I need them to all be drive letter F:, 4 drives when unplugged and plugged back in re-assign correctly, as they are identical USB drives.
However western digital seem incapable of sending us the right drive and we have one that is 320gb instead of 250gb.
I decided to try to write a script which would disconnect any drive using letter F: and reassign it, but I'm having trouble...
here is my script
Code:
Option Explicit
Dim strComputer, objWMIService, colItems, volumeItem, objItem
'On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_Volume Where Name = 'E:\\'")
For Each objItem in colItems
objItem.Dismount True, True
Next
' define available drives
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk WHERE VolumeName = 'Monday' OR VolumeName='Tuesday' OR VolumeName='Wednesday' OR VolumeName='Thursday' OR VolumeName='Friday'",,48)
For Each volumeItem in colItems
volumeItem.DriveLetter = "F:"
volumeItem.Put_
Next
set objWMIService = nothing
set colItems = nothing
set volumeItem = nothing
set objItem = nothing
I'm not getting any errors, but it's not working either.
I have found when going into disk management and manualy assigning the drive letter, the volume name keeps being changed from 'Monday' to 'Local Disk', why is this happening?
can anyone advise how I resolve this issue?
Thanks,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts