Windows Batch File - Automated FTP, Problem with Output Redirection
开发者_JAVA百科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.
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
You need to include -v (verbose) in the arguments to ftp command I guess.
Like - ftp -n -i -v -s:%1
精彩评论