Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个要在批处理模式下运行的 .cmd Windows 脚本。此脚本使用 ftp 命令。在使用 ftp 成功连接到另一台机器后,shell 会发生变化,并且脚本的执行变为交互式。
如何以批处理模式进行操作,以免停止整个脚本的执行?
谢谢。
我认为您可以使用bye退出 ftp 会话以返回批处理。
bye
或者,将 ftp 命令放在单独的批处理文件中并使用call来调用它。
call
rem do stuff rem do ftp stuff call ftpscript.bat rem carry on doing stuff
这段代码对我来说:
ftp -i -n -s:%currentFolderPath%ftp_commands.txt %IPAddress%
读:
MS-DOS ftp 命令