Dénes Tarján
Dénes Tarján

Reputation: 595

how can I save the output of windows internal FTP client?

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?

Upvotes: 1

Views: 12375

Answers (2)

Eric Tuttleman
Eric Tuttleman

Reputation: 1320

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>

Upvotes: 2

Keng
Keng

Reputation: 53111

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

Upvotes: 2

Related Questions