How do I stop this annoying behavior?
Hi
I don't know, but if you do not find asolution, I have created a VBScript that
uses the WMI StdRegProv class to rename driveletters in registry. I guess you
can get sysprep to run program at exit or something (or put it in RunOnce in
registry)?
In that case, use
cscript.exe <path to vbs file>
or if you want to supress any messages (the WScript.Echo part)
cscript.exe //b <path to vbs file>
StdRegProv
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/stdregprov.asp
Put the following in a .vbs file:
' Script that changes drive letters
' Note: Do NOT use it on SYSTEM or BOOT partition drive letters !!!
' Author: Torgeir Bakken
sComputer = "."
Const HKLM = &H80000002
' from/to
If ChangeDrvLetter("E:", "N:") Then
WScript.Echo "Drive letters changed, please reboot to see the change!"
Else
WScript.Echo "Failed changing drive letters!"
End If
Function ChangeDrvLetter(sSourceDrive, sTargetDrive)
bOK = True ' Init value
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv")
sKeyPath = "SYSTEM\MountedDevices"
sSrc = "\DosDevices\" & UCase(sSourceDrive)
iRC = oReg.GetBinaryValue(HKLM, sKeyPath, sSrc, sValue)
If iRC = 0 Then
sTrg = "\DosDevices\" & UCase(sTargetDrive)
iRC = oReg.SetBinaryValue(HKLM, sKeyPath, sTrg, sValue)
If iRC = 0 Then
oReg.DeleteValue HKLM, sKeyPath, sSrc
Else
bOK = False
End If
Else
bOK = False
End If
ChangeDrvLetter = bOK
End Function
--
torgeir
>.
>