Ftp WinSCP-在禁止列出/浏览的目录中重命名文件

Ftp WinSCP-在禁止列出/浏览的目录中重命名文件,ftp,winscp,Ftp,Winscp,我正在使用WinSCP.com而不是FTP.exe,因为它能够使用被动模式。我已经开始将我的FTP脚本转换为WinSCP,并注意到发生了一些事情,我没有解决这些问题的方法 当前脚本-(ftpcommands.txt) 从控制台窗口调用它 Bin\WinSCP.com /script="ftpcommands.txt" /ini=nul 控制台窗口结果 Connecting to ftp.host.com ... Connected Starting the session... Session

我正在使用
WinSCP.com
而不是
FTP.exe
,因为它能够使用被动模式。我已经开始将我的FTP脚本转换为WinSCP,并注意到发生了一些事情,我没有解决这些问题的方法

当前脚本-(ftpcommands.txt)

从控制台窗口调用它

Bin\WinSCP.com /script="ftpcommands.txt" /ini=nul
控制台窗口结果

Connecting to ftp.host.com ...
Connected
Starting the session...
Session started.
Active session: [1] user@ftp.host.com
/
myfile.7z.uploading       |         193 KB |  754.8 KB/s | binary | 100%
Can't get attributes of file 'myfile.7z.uploading'.
Could not retrieve file information
Permission denied.
WinSCP日志文件(使用/log=WinSCP.log开关时)

。2018-08-09 13:09:43.432 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.432 WinSCP版本5.13.3(内部版本8565)(操作系统10.0.17134-Windows 10企业版)
. 2018-08-09 13:09:43.432配置:nul
. 2018-08-09 13:09:43.432日志级别:正常
. 2018-08-09 13:09:43.432本地帐户:银河\用户名
. 2018-08-09 13:09:43.432工作目录:C:\Users\username\Desktop\test文件夹
. 2018-08-09 13:09:43.432过程ID:30844
. 2018-08-09 13:09:43.432命令行:“C:\Users\username\Desktop\test folder\Bin\WinSCP.exe”/console=5.13.3/consoleinstance=\u 18928\u 436”/script=Logs\ftpcommands.txt”“/ini=nul”“/log=WinSCP.log”
. 2018-08-09 13:09:43.432时区:当前:GMT-4,标准:GMT-5(东部标准时间),DST:GMT-4(东部夏时制),DST开始时间:2018年3月11日,DST结束时间:2018年11月4日
. 2018-08-09 13:09:43.510登录时间:2018年8月9日星期四下午1:09:43
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510脚本:回顾性记录以前的脚本记录:
>2018-08-09 13:09:43.510脚本:打开ftp://user:***@ftp.host.com/
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510会议名称:user@ftp.host.com(特设网站)
. 2018-08-09 13:09:43.510主机名:ftp.Host.com(端口:21)
. 2018-08-09 13:09:43.510用户名:用户(密码:是,密钥文件:否,密码短语:否)
. 2018-08-09 13:09:43.510传输协议:FTP
. 2018-08-09 13:09:43.510 Ping类型:假人,Ping间隔:30秒;超时:15秒
. 2018-08-09 13:09:43.510禁用名称:否
. 2018-08-09 13:09:43.510代理人:无
. 2018-08-09 13:09:43.510发送缓冲区:262144
. 2018-08-09 13:09:43.510 UTF:自动
. 2018-08-09 13:09:43.510 FTPS:无[客户证书:无]
. 2018-08-09 13:09:43.510 FTP:被动:是[强制IP:自动];MLSD:Auto[列出全部:自动];主持人:自动
. 2018-08-09 13:09:43.510本地目录:默认,远程目录:主目录,更新:是,缓存:是
. 2018-08-09 13:09:43.510缓存目录更改:是,永久:是
. 2018-08-09 13:09:43.510回收站:删除至:否,覆盖至:否,回收站路径:
. 2018-08-09 13:09:43.510时区偏移:0小时0米
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510连接到ftp.host.com。。。
. 2018-08-09 13:09:43.573已连接ftp.host.com。正在等待欢迎消息。。。
<2018-08-09 13:09:43.588 220欢迎光临
< 2018-08-09 13:09:43.588 220-
<2018-08-09 13:09:43.588 220公司FTP服务器
>2018-08-09 13:09:43.588用户
<2018-08-09 13:09:43.620用户需要331密码
>2018-08-09 13:09:43.620通过****
<2018-08-09 13:09:43.635 230已登录
>2018-08-09 13:09:43.635系统
<2018-08-09 13:09:43.651 215由FileZilla模拟的UNIX
>2018-08-09 13:09:43.651壮举
<2018-08-09 13:09:43.682 211特点:
<2018-08-09 13:09:43.682 MDTM
<2018-08-09 13:09:43.698休息时间
<2018-08-09 13:09:43.698尺码
<2018-08-09 13:09:43.698 MLST型*;大小*;修改*;
<2018-08-09 13:09:43.698百万美元
<2018-08-09 13:09:43.698认证SSL
<2018-08-09 13:09:43.698认证TLS
<2018-08-09 13:09:43.698保护
<2018-08-09 13:09:43.698 PBSZ
<2018-08-09 13:09:43.698 UTF8
<2018-08-09 13:09:43.698 CLNT
<2018-08-09 13:09:43.698 MFMT
<2018-08-09 13:09:43.698 EPSV
<2018-08-09 13:09:43.698 EPRT
<2018-08-09 13:09:43.698 211结束
>2018-08-09 13:09:43.698 CLNT WinSCP-release-5.13.3
<2018-08-09 13:09:43.698 200不在乎
>2018-08-09 13:09:43.698选择UTF8
<2018-08-09 13:09:43.713 202 UTF8模式始终处于启用状态。无需发送此命令。
. 2018-08-09 13:09:43.713已连接
. 2018-08-09 13:09:43.713 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.713使用FTP协议。
. 2018-08-09 13:09:43.713与主机进行启动对话。
>2018-08-09 13:09:43.713 PWD
<2018-08-09 13:09:43.729 257“/”是当前目录。
. 2018-08-09 13:09:43.729获取当前目录名。
. 2018-08-09 13:09:43.729与主机的启动对话已完成。
<2018-08-09 13:09:43.729脚本:活动会话:[1]user@ftp.host.com
>2018-08-09 13:09:43.746脚本:cd/
. 2018-08-09 13:09:43.746将目录更改为“/”。
>2018-08-09 13:09:43.746 CWD/
<2018-08-09 13:09:43.767 250 CWD成功。“/”是当前目录。
. 2018-08-09 13:09:43.767获取当前目录名。
>2018-08-09 13:09:43.767 PWD
<2018-08-09 13:09:43.787 257“/”是当前目录。
<2018-08-09 13:09:43.787脚本:/
>2018-08-09 13:09:43.787脚本:put-transfer=binary“C:\Users\username\Desktop\test folder\myfile.7z.upload”
. 2018-08-09 13:09:43.787将1个文件/目录复制到远程目录“/”—总大小:198017
. 2018-08-09 13:09:43.787时间:是;PrRO:没有;Rght:rw-r--r--;PrR:否(否);FnCs:N;RIC:0100;简历:S(102400);计算:没有;面具:
. 2018-08-09 13:09:43.787 TM:B;克拉尔:没有;主席:没有;雷姆博姆:没有;CPS:0;纽厄尔尼:没有;包括:;简历:0
. 2018-08-09 13:09:43.787 AscM:*.*html;*。htm;*。txt;*。php;*。php3;*。cgi;*。c、 *。cpp;*。h、 *。pas;*。bas;*。tex;*。pl;*。js。htaccess;*。xtml;*。css;*。cfg;*。ini;*。sh;*。xml
. 2018-08-09 13:09:43.787文件:“C:\Users\username\Desktop\test folder\myfile.7z.upload”[2018-08-09T15:41:57.040Z][198017]
. 2018-08-09 13:09:43.787复制“C:\Users\user”
Connecting to ftp.host.com ...
Connected
Starting the session...
Session started.
Active session: [1] user@ftp.host.com
/
myfile.7z.uploading       |         193 KB |  754.8 KB/s | binary | 100%
Can't get attributes of file 'myfile.7z.uploading'.
Could not retrieve file information
Permission denied.
. 2018-08-09 13:09:43.432 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.432 WinSCP Version 5.13.3 (Build 8565) (OS 10.0.17134 - Windows 10 Enterprise)
. 2018-08-09 13:09:43.432 Configuration: nul
. 2018-08-09 13:09:43.432 Log level: Normal
. 2018-08-09 13:09:43.432 Local account: GALAXY\username
. 2018-08-09 13:09:43.432 Working directory: C:\Users\username\Desktop\test folder
. 2018-08-09 13:09:43.432 Process ID: 30844
. 2018-08-09 13:09:43.432 Command-line: "C:\Users\username\Desktop\test folder\Bin\WinSCP.exe" /console=5.13.3 /consoleinstance=_18928_436 "/script=Logs\ftpcommands.txt" "/ini=nul" "/log=winscp.log" 
. 2018-08-09 13:09:43.432 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/11/2018, DST End: 11/4/2018
. 2018-08-09 13:09:43.510 Login time: Thursday, August 9, 2018 1:09:43 PM
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510 Script: Retrospectively logging previous script records:
> 2018-08-09 13:09:43.510 Script: open ftp://user:***@ftp.host.com/
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510 Session name: user@ftp.host.com (Ad-Hoc site)
. 2018-08-09 13:09:43.510 Host name: ftp.host.com (Port: 21)
. 2018-08-09 13:09:43.510 User name: user (Password: Yes, Key file: No, Passphrase: No)
. 2018-08-09 13:09:43.510 Transfer Protocol: FTP
. 2018-08-09 13:09:43.510 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2018-08-09 13:09:43.510 Disable Nagle: No
. 2018-08-09 13:09:43.510 Proxy: None
. 2018-08-09 13:09:43.510 Send buffer: 262144
. 2018-08-09 13:09:43.510 UTF: Auto
. 2018-08-09 13:09:43.510 FTPS: None [Client certificate: No]
. 2018-08-09 13:09:43.510 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2018-08-09 13:09:43.510 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2018-08-09 13:09:43.510 Cache directory changes: Yes, Permanent: Yes
. 2018-08-09 13:09:43.510 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2018-08-09 13:09:43.510 Timezone offset: 0h 0m
. 2018-08-09 13:09:43.510 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.510 Connecting to ftp.host.com ...
. 2018-08-09 13:09:43.573 Connected with ftp.host.com. Waiting for welcome message...
< 2018-08-09 13:09:43.588 220-Welcome
< 2018-08-09 13:09:43.588 220-
< 2018-08-09 13:09:43.588 220-Company FTP Server
> 2018-08-09 13:09:43.588 USER user
< 2018-08-09 13:09:43.620 331 Password required for user
> 2018-08-09 13:09:43.620 PASS ****
< 2018-08-09 13:09:43.635 230 Logged on
> 2018-08-09 13:09:43.635 SYST
< 2018-08-09 13:09:43.651 215 UNIX emulated by FileZilla
> 2018-08-09 13:09:43.651 FEAT
< 2018-08-09 13:09:43.682 211-Features:
< 2018-08-09 13:09:43.682  MDTM
< 2018-08-09 13:09:43.698  REST STREAM
< 2018-08-09 13:09:43.698  SIZE
< 2018-08-09 13:09:43.698  MLST type*;size*;modify*;
< 2018-08-09 13:09:43.698  MLSD
< 2018-08-09 13:09:43.698  AUTH SSL
< 2018-08-09 13:09:43.698  AUTH TLS
< 2018-08-09 13:09:43.698  PROT
< 2018-08-09 13:09:43.698  PBSZ
< 2018-08-09 13:09:43.698  UTF8
< 2018-08-09 13:09:43.698  CLNT
< 2018-08-09 13:09:43.698  MFMT
< 2018-08-09 13:09:43.698  EPSV
< 2018-08-09 13:09:43.698  EPRT
< 2018-08-09 13:09:43.698 211 End
> 2018-08-09 13:09:43.698 CLNT WinSCP-release-5.13.3
< 2018-08-09 13:09:43.698 200 Don't care
> 2018-08-09 13:09:43.698 OPTS UTF8 ON
< 2018-08-09 13:09:43.713 202 UTF8 mode is always enabled. No need to send this command.
. 2018-08-09 13:09:43.713 Connected
. 2018-08-09 13:09:43.713 --------------------------------------------------------------------------
. 2018-08-09 13:09:43.713 Using FTP protocol.
. 2018-08-09 13:09:43.713 Doing startup conversation with host.
> 2018-08-09 13:09:43.713 PWD
< 2018-08-09 13:09:43.729 257 "/" is current directory.
. 2018-08-09 13:09:43.729 Getting current directory name.
. 2018-08-09 13:09:43.729 Startup conversation with host finished.
< 2018-08-09 13:09:43.729 Script: Active session: [1] user@ftp.host.com
> 2018-08-09 13:09:43.746 Script: cd /
. 2018-08-09 13:09:43.746 Changing directory to "/".
> 2018-08-09 13:09:43.746 CWD /
< 2018-08-09 13:09:43.767 250 CWD successful. "/" is current directory.
. 2018-08-09 13:09:43.767 Getting current directory name.
> 2018-08-09 13:09:43.767 PWD
< 2018-08-09 13:09:43.787 257 "/" is current directory.
< 2018-08-09 13:09:43.787 Script: /
> 2018-08-09 13:09:43.787 Script: put -transfer=binary "C:\Users\username\Desktop\test folder\myfile.7z.uploading"
. 2018-08-09 13:09:43.787 Copying 1 files/directories to remote directory "/" - total size: 198,017
. 2018-08-09 13:09:43.787   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: 
. 2018-08-09 13:09:43.787   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2018-08-09 13:09:43.787   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2018-08-09 13:09:43.787 File: 'C:\Users\username\Desktop\test folder\myfile.7z.uploading' [2018-08-09T15:41:57.040Z] [198017]
. 2018-08-09 13:09:43.787 Copying "C:\Users\username\Desktop\test folder\myfile.7z.uploading" to remote directory started.
. 2018-08-09 13:09:43.787 Binary transfer mode selected.
. 2018-08-09 13:09:43.787 Starting upload of C:\Users\username\Desktop\test folder\myfile.7z.uploading
> 2018-08-09 13:09:43.787 TYPE I
< 2018-08-09 13:09:43.803 200 Type set to I
> 2018-08-09 13:09:43.803 PASV
< 2018-08-09 13:09:43.818 227 Entering Passive Mode (1,2,3,4,17,147)
> 2018-08-09 13:09:43.818 STOR myfile.7z.uploading
. 2018-08-09 13:09:43.818 Connecting to 1.2.3.4:4499 ...
< 2018-08-09 13:09:43.865 150 Opening data channel for file upload to server of "/myfile.7z.uploading"
< 2018-08-09 13:09:44.084 226 Successfully transferred "/myfile.7z.uploading"
> 2018-08-09 13:09:44.084 MFMT 20180809154157 myfile.7z.uploading
< 2018-08-09 13:09:44.100 550 Permission denied
. 2018-08-09 13:09:44.100 Upload successful
. 2018-08-09 13:09:44.100 Transfer done: 'C:\Users\username\Desktop\test folder\myfile.7z.uploading' => '/myfile.7z.uploading' [198017]
. 2018-08-09 13:09:44.100 Copying finished: Transferred: 198,017, Elapsed: 0:00:00, CPS: 776,209/s
> 2018-08-09 13:09:44.100 Script: mv "myfile.7z.uploading" "myfile.7z"
. 2018-08-09 13:09:44.100 Listing file "myfile.7z.uploading".
. 2018-08-09 13:09:44.100 Retrieving file information...
> 2018-08-09 13:09:44.100 MLST /myfile.7z.uploading
< 2018-08-09 13:09:44.131 550 Permission denied.
. 2018-08-09 13:09:44.131 Could not retrieve file information
< 2018-08-09 13:09:44.131 Script: Can't get attributes of file 'myfile.7z.uploading'.
< 2018-08-09 13:09:44.131 Could not retrieve file information

< 2018-08-09 13:09:44.131 Permission denied.
. 2018-08-09 13:09:44.131 Script: Failed
. 2018-08-09 13:09:44.131 Script: Exit code: 1
. 2018-08-09 13:09:44.131 Disconnected from server
call RNFR myfile.7z.uploading
call RNTO myfile.7z