I have the following code when I am running it manually it works perfect, as soon as I login it can not open the file:

IF Open(1,"c:\templog.txt",2)= 0
?"@ERROR : @SERROR"
sleep 1
$result = ReadLine(1)
$x = SUBSTR("$result",20,15)
$ = Close(1)
ELSE
? "File not open"
sleep 2
EndIf
? $x
Any ideas?