Windows批处理文件 - 自动FTP,输出重定向问题

时间:2022-01-19 02:23:32

I'm having an odd problem with a batch file that is used to FTP a file. The log file is getting populated with the text that is ECHOed by the batch file but it does not contain the output of the FTP command.

我对用于FTP文件的批处理文件有一个奇怪的问题。日志文件将填充批处理文件ECHOed的文本,但不包含FTP命令的输出。

Any thoughts?

Command

psend.bat 1234356.cmd 123456.log

Batch File

echo Starting >%2
echo %1 >>%2
echo %2 >>%2
echo Starting FTP >>%2
echo ftp -n -s:%1 >>%2 2>>%2
echo Finished FTP

Log File

Starting
123456.cmd
123456.log
Starting FTP
Finished FTP

1 个解决方案

#1


0  

You need to include -v (verbose) in the arguments to ftp command I guess. Like - ftp -n -i -v -s:%1

你需要在ftp命令的参数中包含-v(详细)。喜欢 - ftp -n -i -v -s:%1

#1


0  

You need to include -v (verbose) in the arguments to ftp command I guess. Like - ftp -n -i -v -s:%1

你需要在ftp命令的参数中包含-v(详细)。喜欢 - ftp -n -i -v -s:%1