MSDN explica una solución a este problema utilizando el proceso "MountVol" ~>
http://blogs.msdn.com/b/alejacma/archive/2010/03/17/how-to-change-drive-letters-vbscript.aspxHe modificado un poco el Snippet y he tomado parte del código para añadir el Método que desmonta la unidad (más abajo):
Sub ChangeDriveLetter(SourceDrive, TargetDrive)
Set WSS = WScript.CreateObject("WScript.Shell")
If Not Right(SourceDrive, 1) = ":" Then
SourceDrive = SourceDrive & ":"
End If
If Not Right(TargetDrive, 1) = ":" Then
TargetDrive = TargetDrive & ":"
End If
' Get volume associated to the old drive letter.
Set Exec = WSS.Exec("mountvol.exe " & SourceDrive & " /L")
strVolume = Trim(Exec.StdOut.ReadLine())
while Exec.Status = 0 : WScript.Sleep(100) : Wend
' Unmount the drive.
Set Exec = WSS.Exec("mountvol.exe " & SourceDrive & " /D")
while Exec.Status = 0 : WScript.Sleep(100) : Wend
' Mount the drive on the new drive letter.
Set Exec = WSS.Exec("mountvol.exe " & TargetDrive & " " & strVolume)
while Exec.Status = 0 : WScript.Sleep(100) : Wend
End Sub
Sub UnmountDrive(DriveLetter)
Set WSS = WScript.CreateObject("WScript.Shell")
If Not Right(DriveLetter, 1) = ":" Then
DriveLetter = DriveLetter & ":"
End If
' Unmount the drive.
Set Exec = WSS.Exec("mountvol.exe " & DriveLetter & " /D")
while Exec.Status = 0 : WScript.Sleep(100) : Wend
End Sub
Ejemplos de uso:
ChangeDriveLetter "Z", "X"
Saludos.