I want to create a logfile of a FTP operation within a script. That's the relevant code:

:ftp
$log=@date+"_"+@time
RedirectOutput ("c:\logs\Download_$log.txt", 1)
? "Download " $log
?
Shell "ftp -i -s:c:\download.txt"

Open (1,"c:\logs\Download_$log.txt",2)

$L=ReadLine(1)

While @error=0
If InStr($L,"nicht verbunden.") GoTo repeat EndIf
$L=ReadLine(1)
Loop

For some reason it doesn't create the logfile. The strangest thing is that I have a login script with the same syntax which is working fine.
I use KixScript Version 4.21. Any ideas ?