It adds to computer name (or part of it) every time the script runs. That is why you see it two, three, four, five.....times.

You do want it to update the computer name if needed. Doesn't happen that often but what if....... Deleting it before opening the file would fix this. I made a small modification to Shane's script.

 Code:
Break on

If Exist("Sometextfile.txt")
	Del "sometextfile.txt"
EndIf

;Open text file. Create it when it does not exist.
$rc = Open(1, "Sometextfile.txt", 5)
	
;Get last three characters from @wksta.
$hostname = Right(@WKSTA, 3)
	
;Write to text file.
$rc = WriteLine(1, $hostname)
	
;Close text file.
$rc = Close(1)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.