Ok, lets dump some of the DOS stuff.

You have an app called psloggedon that creates the found.txt text file right?

You can use the ReadFile UDF to read the entire file into memory after psloggedon created it. Then do a line by line check to see if it is the domain\username line and do some things if it is. This way you do not need to set a DOS environment variable to use the username in kix. This eliminates a point of error.

Example:
 Code:
Break on

;Read the entire file into memory. Change the path to fit your setup.
$file = ReadFile("c:\found.txt")

;Do the magic on each separate line.
For Each $line in $file
	;Check to see if the line starts with DomainName\. Change this to fit your setup.
	;Also change the 11 to match the number of characters for your domain + a \.
	If Left($line, 11) = "Domainname\"
		;Split the line on the \.
		$line = Split($line, "\")
		;Display the last element of the array you just created by splitting the line.
		? $split[UBound($split)]
	EndIf
Next


;Function	ReadFile()  
;  
;Author		Radimus  
;  
;Contributors	Lonky... This is basically his code that I trimmed down to its  
;		simplest function  
;  
;Action		Reads a file into an array  
;  
;Syntax		$array=ReadFile($file)  
;  
;Version	1.0.1  
;  
;Date           10/21/2003  
;  
;Date Revised   10-22-2003 - dimmed vars 
;  
;Parameters 	file   
;		source filename  
;  
;Remarks	Pair this with WriteFile() to read and write an entire file easily  
;  
;Returns	@error if failed  
;   
;Dependencies 	None  
;  
;KiXtart Ver	4.02  
;   
;Example(s)	$array=ReadFile('c:\file.txt')  

Function ReadFile($file)
	Dim $lf, $f, $_, $t
	$lf = Chr(10)
	$f = FreeFileHandle
	$_ = Open($f, $file)
	If @error Exit @error EndIf
	Do $t = $t + $lf + ReadLine($f) Until @error
	$_ = Close($f)
	$ReadFile = Split(SubStr($t, 2), $lf)
EndFunction
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.