This way it unfortunately doesn't work. FTP doesn't recognize the logfile path and just outputs a list of parameters (like FTP /?).
Now I run this command (ftp > logfile.txt) in a seperate cmd which I start using the shell command and this works fine.