I can't for the life of me figure this out... Basically I am reading a registry value and if it exists I am writing to a text file. I want the testfile to be @DATE_Clientname.txt. If the file does not exist I want to create the file. I know it is reading correctly but I can't see why it's not writing. I have read the documentation but I don't understand the problem! I am getting error code 3.
This should be another easy one.
Thanks!
Matt
Code:
DIM $IcaClientName, $x
$IcaClientName = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client", "ClientName")
If @ERROR = 0
? "Citrix ClientName: $IcaClientName"
IF Open(1, "\\servername\sharename\Citrix\" + @DATE + " _clientname.txt") = 0
$x = WriteLine( 3 , @TIME +" " + @DATE + " " + @WKSTA + " has a static client name and it is " + $IcaClientName + @CRLF);
Close(1)
ELSE
BEEP
? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
Endif