You could try using the Execute() function to translate any macros/vars or env-vars to text.

Your test.kix should then be like this:
Code:

If Open (1,@LSERVER + "\store\logon.ini",2) = 0
$cmd = ReadLine(1)
While @ERROR = 0 ;eof
$RC = Execute('$$cmd=$cmd')
Shell $cmd
$cmd = ReadLine(1)
Loop
$ = Close (1)
EndIf



-Erik