views:

746

answers:

2

Hi,

UPDATED: on win2k it seems it works OK. Sorry for the confusion.

MS Windows Vista internal ftp client has a strange behavior. When redirecting its output and error to a file, the errors do not show up there:

ftp -n -s:commands.txt host >output.log 2>&1

When running it from Task Scheduler inside a batch file, I don't get any error messages if connection refused. Even if echo is on or with the -d option. Do you have a workaround for it?

+1  A: 

have you tried it without the "2>&1"? we do this all the time but in this format

ftp -s:FTPCMD.FTP > R:\foo\bar\FTPGET.LOG
Keng
+1  A: 

Not sure what's happening to you. I'd check the batch file that's running it, or maybe how you're scheduling the job.

The output is confusing as the error seems out of order, but redirecting stderr seems to work on my XP machine:

C:\Temp>ftp -s:ftpcmds.txt ftp.microsxoft.com >ftplog.txt 2>&1

C:\Temp>type ftplog.txt
ftp> Not connected.
ftp> USER sconners
Invalid command.
ftp> PASS skynet.com
Not connected.
ftp> PUT test.txt test1.txt
BYE
> ftp: connect :Unknown error number

C:\Temp>
Eric Tuttleman