gpt4 book ai didi

windows - 使用批处理命令自动连接到 FTP 服务器,继续使用批处理脚本,然后在必要时运行 FTP 命令

转载 作者:可可西里 更新时间:2023-11-01 10:00:08 25 4
gpt4 key购买 nike

这是我想做的。是否可以使用批处理 (Windows XP) 文件?

  1. 提示用户登录 FTP 服务器。

  2. 继续执行其余的批处理命令,同时保持 FTP session /登录事件。

  3. 需要时使用 FTP PUT 命令和批处理命令。

最佳答案

不,我想不出在继续运行批处理文件并向 ftp 进程发送命令的同时让 ftp 进程保持事件状态的方法。

但是,如果这符合您的需要,您的批处理文件可以首先收集它需要的所有数据,生成一个包含所有 ftp 命令的文件,然后作为最后一步将该文件传递给 ftp.exe。

例如:

SET /P ftpuser=Username:
SET /P ftppass=Password:

:: generate ftp script file
ECHO %ftpuser% > ftpcommands.txt
ECHO %ftppass% >> ftpcommands.txt
ECHO put file.txt >> ftpcommands.txt
ECHO quit >> ftpcommands.txt

:: now call ftp and have it process all the commands
ftp -s:ftpcommands.txt server.com

关于windows - 使用批处理命令自动连接到 FTP 服务器,继续使用批处理脚本,然后在必要时运行 FTP 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15253650/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com