我创建了以下名称为的命令文件submitCmd.txt:
open myname@ftpclients.myserve.com -privatekey=C:\Users\Mike\Desktop\uploader\mykey.ppk
put C:\Users\Mike\Desktop\uploader\files2Upload\myFile.xlsx /mnt/data/myFolder/
close
exit
当我从命令行运行上述脚本时:
winscp.com /script=C:\Users\Mike\Desktop\uploader\submitCmd.txt
它运行成功。
但是,当我在 python 中尝试以下操作时:
cmdFile = r'C:\Users\Mike\Desktop\uploader\submitCmd.txt'
import subprocess
subprocess.run(["winscp.com", "/script=", cmdFile], shell=True)
我收到错误:
Searching for host...
Host "C" does not exist.
winscp>
相关分类