Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Sessl

After checking the log file again and again and ag... I found a row that differs from the old log:

. 2014-04-17 11:16:24.681 Session name: my@session (Ad-Hoc site)


On your very good support side I found out, that I have to use doubling double-quotes! Which I forgot on the open command!

"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\Program Files (x86)\WinSCP\scp_log.txt" /command "option batch on" "option confirm off" "option transfer automatic" "open my@session" "put ""%target%\%var%""" "close" "exit"


"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\Program Files (x86)\WinSCP\scp_log.txt" /command "option batch on" "option confirm off" "option transfer automatic" "open ""my@session""" "put ""%target%\%var%""" "close" "exit"


Don't know why it works before, but now I found the solution.
Thanks for your support side!

Tobias


[edit]
The double-quotes weren't the problem, because my used session uses the reg entry from a wrong user. I've exported my session to the *.ini file and use that file instead of the registry entry.
[/edit]
Sessl

V.5.5.3. B.4214 Scripting - SFTP instead of FTP

Hi,

I've switched our server from 2k3 to 2k8, installed a new version of WinSCP (4.3.2 > 5.5.3) and copied my script.
After starting WinSCP and configured the connection (FTP address, user, password) and saved as session, I tried the script if its still working, it doesn't.

The problem, in the session I've setup a FTP connection. In the script I called this session:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\Program Files (x86)\WinSCP\scp_log.txt" /command "option batch on" "option confirm off" "option transfer automatic" "open my@session" "put ""%target%\%var%""" "close" "exit"


but in the log file I see that the transfer protocol SFTP is used:

. 2014-04-17 11:16:24.680 --------------------------------------------------------------------------

. 2014-04-17 11:16:24.681 WinSCP Version 5.5.3 (Build 4214) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2014-04-17 11:16:24.681 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2014-04-17 11:16:24.681 Local account: domain\user
. 2014-04-17 11:16:24.681 Working directory: D:\usr\sap\SID\DVEBMGS00\work
. 2014-04-17 11:16:24.681 Process ID: 3300
. 2014-04-17 11:16:24.681 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=553 /consoleinstance=_10228_912 "/log=C:\Program Files (x86)\WinSCP\scp_log.txt" "/command" "option batch on" "option confirm off" "option transfer automatic" "open my@session" "put ""\\target\0000137084.pdf""" "close" "exit"
. 2014-04-17 11:16:24.681 Time zone: Current: GMT+2, Standard: GMT+1 (W. Europe Standard Time), DST: GMT+2 (W. Europe Daylight Time), DST Start: 3/30/2014, DST End: 10/26/2014
. 2014-04-17 11:16:24.681 Login time: Thursday, April 17, 2014 11:16:24 AM
. 2014-04-17 11:16:24.681 --------------------------------------------------------------------------
. 2014-04-17 11:16:24.681 Script: Retrospectively logging previous script records:
> 2014-04-17 11:16:24.681 Script: option batch on
< 2014-04-17 11:16:24.681 Script: batch           on       
> 2014-04-17 11:16:24.681 Script: option confirm off
< 2014-04-17 11:16:24.681 Script: confirm         off       
> 2014-04-17 11:16:24.681 Script: option transfer automatic
< 2014-04-17 11:16:24.681 Script: transfer        automatic
> 2014-04-17 11:16:24.681 Script: open my@session
. 2014-04-17 11:16:24.681 --------------------------------------------------------------------------
. 2014-04-17 11:16:24.681 Session name: my@session (Ad-Hoc site)
. 2014-04-17 11:16:24.681 Host name: 192.168.1.1 (Port: 22)
. 2014-04-17 11:16:24.681 User name: USER (Password: No, Key file: No)
. 2014-04-17 11:16:24.681 Tunnel: No
. 2014-04-17 11:16:24.681 Transfer Protocol: SFTP (SCP)
. 2014-04-17 11:16:24.681 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2014-04-17 11:16:24.681 Proxy: none
. 2014-04-17 11:16:24.681 Send buffer: 262144
. 2014-04-17 11:16:24.681 SSH protocol version: 2; Compression: No
. 2014-04-17 11:16:24.681 Bypass authentication: No
. 2014-04-17 11:16:24.681 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-04-17 11:16:24.681 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-04-17 11:16:24.681 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-04-17 11:16:24.681 Simple channel: Yes
. 2014-04-17 11:16:24.681 Return code variable: Autodetect; Lookup user groups: A
. 2014-04-17 11:16:24.681 Shell: default
. 2014-04-17 11:16:24.681 EOL: 0, UTF: 2
. 2014-04-17 11:16:24.681 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-04-17 11:16:24.681 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-04-17 11:16:24.681 SFTP Bugs: A,A
. 2014-04-17 11:16:24.681 SFTP Server: default
. 2014-04-17 11:16:24.681 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-04-17 11:16:24.681 Cache directory changes: Yes, Permanent: Yes
. 2014-04-17 11:16:24.681 DST mode: 1; Timezone offset: 0h 0m
. 2014-04-17 11:16:24.682 --------------------------------------------------------------------------
. 2014-04-17 11:16:24.682 Looking up host "192.168.1.1"
. 2014-04-17 11:16:24.682 Connecting to 192.168.1.1 port 22


I've also tried the old version, but I get the same error.
So, what is the problem, why is WinSCP switching from FTP to SFTP and why is my script not working anymore, because I don't changed anything.

I just wanna ask before I will change my script ..

Thanks for any advise!

Best regards,
Tobias