Dim $User1, $ID, $RC, $User2
If @WKSTA="TS-SERVER"
$User1 = ReadValue('HKCU\Software\GoldMine\GoldMine Link for Microsoft Outlook','GMUserName')
If Not $User1
Shell 'regedit /s "\\MAIN-SERVER\Support\Goldmine\GISMO\GISMO.reg"'
$ID = ReadProfileString('\\MAIN-SERVER\Support\Goldmine\GISMO\GISMO.ini','names',@FULLNAME)
If Not $ID
" GISMO Not Configured!!" ?
" Cant find GM User ID for " + @LDOMAIN + "\" + @FULLNAME ?
; The line below should never display $User1 as it should only get here if it is blank
" Current GM User ID: " + $User1
Else
; The $RC line will be wrong as it should also only get here if $ID is blank so you would write a blank
; Which in turn would actually delete the value if one is there
$RC = WriteValue('HKCU\Software\GoldMine\GoldMine Link for Microsoft Outlook','GMUserName',$ID,REG_SZ)
$User2 = ReadValue('HKCU\Software\GoldMine\GoldMine Link for Microsoft Outlook','GMUserName')
" GISMO Configured for " + @LDOMAIN + "\" + @FULLNAME + " - Current GM User ID: " + $User2 ?
EndIf
Else
; This line shold always be blank for $User1 as you've not read it from the Registry yet
; And it only got here because the name of the system was not "TS-SERVER"
" GISMO Configuration Not Changed! - Current GM User ID: " + $User1 ?
EndIf