简体   繁体   中英

windows batch script execution becomes interactive after using ftp

I am writing a .cmd Windows script to be run in batch mode. This script uses the ftp command. After a successsful connection to another machine using ftp, the shell changes, and the execution of the script becomes interactive.

How can I make it in batch mode, so as not to stop the execution of he whole script?

thanks.

I think you can use bye to quit an ftp session to return to the batch.

Alternatively, put the ftp commands in a separate batch file and use call to call it.

rem do stuff
rem do ftp stuff
call ftpscript.bat
rem carry on doing stuff

This code for me:

ftp -i -n -s:%currentFolderPath%ftp_commands.txt %IPAddress%

Read:

MS-DOS ftp command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM