So the way this works is...
The MountedDevices registry key contains subkeys with values. There are subkeys named for the GUIDs of volumes, and there are subkeys named for the DOS drive letter of a volume. In either case the subkey value will be some hex number that references the actual volume. Typically this means that there are two entries for every volume, one entry with the GUID, and one with the DOS letter.
So, to find a GUID from a DOS drive letter, you have to check each subkey for the hex number. If you get a hit, you have to make sure you aren't just re-discovering the DOS letter again, and then you have to form the string to return.
Chris, you put the & "\" in the wrong place. Also, AutoIt for some reason doesn't seem to accept "+=" syntax anymore. So a better FindGUID function is....
Func FindGUID($Drive)
Local Const $DevList = "HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices"
Local $i=1
Do
If RegRead($DevList, "\DosDevices\" & $Drive) = RegRead($DevList, RegEnumVal($DevList, $i)) Then
$s_ReturnValue = StringReplace(RegEnumVal($DevList, $i), "\??\", "\\?\", 1)
If $s_ReturnValue <> "\DosDevices\" & $Drive Then Return $s_ReturnValue & "\"
EndIf
$i = $i + 1
Until $i = 0
EndFunc