$intSelect = LoadHive("HKEY_USERS\Temp","\\path\to\desired\ntuser.dat")
If $intSelect = 0
; Get printer info.
$strDefP = ReadValue("HKEY_USERS\Temp\Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device")
$strDefP = Substr($strDefP,1,Instr($strDefP,",")-1)
$intErr = WriteProfileString($strFile,"Printers","Default",$strDefP)
$intSelect = 0
$intIndex2 = 0
$strKey = EnumKey("HKEY_USERS\Temp\Printers\Connections", $intSelect)
While @Error = 0
ReDim Preserve $arrMap[1,$intIndex2]
$temp = Split($strKey,","4)
$arrMap[0, $intIndex2] = $temp[2]
$arrMap[1, $intIndex2] = $temp[3]
$intErr = WriteProfileString($strFile,"Printers",$arrMap[0, $intIndex2],$arrMap[1, $intIndex2])
$intIndex2 = $intIndex2 + 1
$intSelect = $intSelect + 1
$strKey = EnumKey("HKEY_USERS\Temp\Printers\Connections", $intSelect)
Loop
$intSelect = UnLoadHive("HKEY_USERS\Temp")
If $intSelect <> 0
? "Open regedit and check HKEY_USERS\Temp. It was not unloaded."
EndIf
Else
? "Could not load the hive, ..."
EndIf