First off pretty new to scripting and have inherited this logon script that has been in place for a few years with no issues. I was tasked with building up a new Citrix environment since our current one is several years out dated with no upgrade path. Using the existing script in the new environment seems to work just fine with the exception of the part of the code where we're trying to pull values from the registry & write those values to a text file. The one major difference between the old & new Citrix is the new is Win7 64bit, where the old was x86 Win7. We're using KiXtart 2010 4.66.

I'm hoping that it's something simple we are missing and one of you experts can point that out. Thanks in advance!

Here is the snipet of the script...

 Code:
If (@TSSESSION <> 1)
	; client ip extraction from vm
	$ClientAddress = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA\Session", "ClientAddress")
        $ClientName = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA\Session", "ClientName")
	
	If $ClientAddress <> ""
	IF EXIST ("%SystemDrive%\is\-GetThinClient.TXT")
		Del "%SystemDrive%\is\-GetThinClient.TXT"
	Endif
	writeprofilestring("%SystemDrive%\is\-GetThinClient.TXT", "CLIENT", "Name","$ClientName")
	writeprofilestring("%SystemDrive%\is\-GetThinClient.TXT", "CLIENT", "IP","$ClientAddress")
	writeprofilestring("%SystemDrive%\is\-GetThinClient.TXT", "VIRTUAL", "Name","@Wksta")
	writeprofilestring("%SystemDrive%\is\-GetThinClient.TXT", "VIRTUAL", "IP","@IPAddress0")
	EndIf
Endif