I've finally got the code I need and after lots of testing this seems to work perfectly.

Thanks to Radimus for pointing me in the right direction and to everyone else who helped.

If your interested, my final code is below.

	$User1=ReadValue('HKEY_CURRENT_USER\Software\GoldMine\GoldMine Link for Microsoft Outlook','GMUserName')
	If $User1=''
		Shell 'regedit /s "\\MAIN-SERVER\Support\Goldmine\GISMO\GISMO.reg"'
		if $id =""
			?"    GISMO Not Configured!!"
			?"      Cant find GM User ID for " + @LDOMAIN "\" + @FULLNAME
			?"          Current GM User ID: " + $User1
			WriteValue("HKCU\Software\GoldMine\GoldMine Link for Microsoft Outlook","GMUserName","$id","REG_SZ")
			$User2=ReadValue('HKEY_CURRENT_USER\Software\GoldMine\GoldMine Link for Microsoft Outlook','GMUserName')
			?"  GISMO Configured for " + @LDOMAIN "\" + @FULLNAME "	- Current GM User ID: " + $User2
		?"  GISMO Configuration Not Changed!	- Current GM User ID: " + $User1

Once I've double checked that the AD FullName matches all the GoldMine FullNames, I will eventually rem out the If $USER='' entry and quite possibly the IF @WKSTA="TS-SERVER" so all PC's on my network are automatically setup.

This does mean I have to keep an .ini file up to date but that's reasonably easy to create from the .dbf file.

This is working but if anyone has any other ideas or better code, please let me know.

Thanks again,