我创建了以下名称为的命令文件submitCmd.txt:open myname@ftpclients.myserve.com -privatekey=C:\Users\Mike\Desktop\uploader\mykey.ppkput C:\Users\Mike\Desktop\uploader\files2Upload\myFile.xlsx /mnt/data/myFolder/closeexit当我从命令行运行上述脚本时:winscp.com /script=C:\Users\Mike\Desktop\uploader\submitCmd.txt它运行成功。但是,当我在 python 中尝试以下操作时:cmdFile = r'C:\Users\Mike\Desktop\uploader\submitCmd.txt'import subprocesssubprocess.run(["winscp.com", "/script=", cmdFile], shell=True)我收到错误:Searching for host...Host "C" does not exist.winscp>
添加回答
举报
0/150
提交
取消