Exit command doesn't work

Advertisement

IlSommo
Guest

Exit command doesn't work

This is the command use in my batch file:
winscp.com /command "open sftp://MYUSER:MYPASSWORD@SERVER_IP_ADDRESS" "cd /Outbox" "exit" /log="C:\MY_winscp.log" /loglevel=2

All is work fine but winscp doesn't exit and batch procedure stop.

If I follow these command manualy from console exit doean't close and return to Dos Promot also.

This is the log. Could you help me ? Why it not exit ?
2018-05-18 12:32:12.238 --------------------------------------------------------------------------
. 2018-05-18 12:32:12.238 WinSCP Version 5.13.2 (Build 8455) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2018-05-18 12:32:12.238 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2018-05-18 12:32:12.238 Log level: Debug 2
. 2018-05-18 12:32:12.238 Local account: MYACCOUNT
. 2018-05-18 12:32:12.238 Working directory: C:\Program Files (x86)\WinSCP
. 2018-05-18 12:32:12.238 Process ID: 3616
. 2018-05-18 12:32:12.238 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=5.13.2 /consoleinstance=_4328_996 "/command" "open sftp://MYPROFILE:***@MYIPADDRESS" "cd /Outbox" "exit" "/log=C:\Program Files (x86)\WinSCP\AA_winscp.log" "/loglevel=2"
. 2018-05-18 12:32:12.238 Switch: /console=5.13.2
. 2018-05-18 12:32:12.238 Switch: /consoleinstance=_4328_996
. 2018-05-18 12:32:12.238 Switch: /command
. 2018-05-18 12:32:12.238 Parameter: open sftp://MYPROFILE:xVCRx2sV@MYIPADDRESS
. 2018-05-18 12:32:12.238 Parameter: cd /Outbox
. 2018-05-18 12:32:12.238 Parameter: exit
. 2018-05-18 12:32:12.238 Switch: /log=C:\Program Files (x86)\WinSCP\AA_winscp.log
. 2018-05-18 12:32:12.238 Switch: /loglevel=2
. 2018-05-18 12:32:12.238 Time zone: Current: GMT+2, Standard: GMT+1 (W. Europe Standard Time), DST: GMT+2 (W. Europe Daylight Time), DST Start: 25/03/2018, DST End: 28/10/2018
. 2018-05-18 12:32:12.238 Login time: venerdì 18 maggio 2018 12:32:12
. 2018-05-18 12:32:12.238 --------------------------------------------------------------------------
. 2018-05-18 12:32:12.238 Script: Retrospectively logging previous script records:
> 2018-05-18 12:32:12.238 Script: open sftp://MYPROFILE:***@MYIPADDRESS
> 2018-05-18 12:32:12.238 Script: Parameter: sftp://MYPROFILE:***@MYIPADDRESS
. 2018-05-18 12:32:12.238 --------------------------------------------------------------------------
. 2018-05-18 12:32:12.238 Session name: MYPROFILE@MYIPADDRESS (Ad-Hoc site)
. 2018-05-18 12:32:12.238 Host name: MYIPADDRESS (Port: 22)
. 2018-05-18 12:32:12.238 User name: MYPROFILE (Password: Yes, Key file: No, Passphrase: No)
. 2018-05-18 12:32:12.238 Tunnel: No
. 2018-05-18 12:32:12.238 Transfer Protocol: SFTP
. 2018-05-18 12:32:12.238 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2018-05-18 12:32:12.238 Disable Nagle: No
. 2018-05-18 12:32:12.238 Proxy: None
. 2018-05-18 12:32:12.238 Send buffer: 262144
. 2018-05-18 12:32:12.238 SSH protocol version: 2; Compression: No
. 2018-05-18 12:32:12.238 Bypass authentication: No
. 2018-05-18 12:32:12.238 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2018-05-18 12:32:12.238 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2018-05-18 12:32:12.238 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2018-05-18 12:32:12.238 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2018-05-18 12:32:12.238 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2018-05-18 12:32:12.238 Simple channel: Yes
. 2018-05-18 12:32:12.238 Return code variable: Autodetect; Lookup user groups: Auto
. 2018-05-18 12:32:12.238 Shell: default
. 2018-05-18 12:32:12.238 EOL: LF, UTF: Auto
. 2018-05-18 12:32:12.238 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2018-05-18 12:32:12.238 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2018-05-18 12:32:12.238 SFTP Bugs: Auto,Auto
. 2018-05-18 12:32:12.238 SFTP Server: default
. 2018-05-18 12:32:12.238 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2018-05-18 12:32:12.238 Cache directory changes: Yes, Permanent: Yes
. 2018-05-18 12:32:12.238 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2018-05-18 12:32:12.238 DST mode: Unix
. 2018-05-18 12:32:12.238 --------------------------------------------------------------------------
. 2018-05-18 12:32:12.238 Looking up host "MYIPADDRESS" for SSH connection
. 2018-05-18 12:32:12.238 Connecting to MYIPADDRESS port 22
. 2018-05-18 12:32:12.472 Selecting events 63 for socket 908
. 2018-05-18 12:32:12.472 We claim version: SSH-2.0-WinSCP_release_5.13.2
. 2018-05-18 12:32:12.472 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:12.472 Looking for incoming data
. 2018-05-18 12:32:12.472 Looking for network events
. 2018-05-18 12:32:12.472 Detected network event
. 2018-05-18 12:32:12.472 Enumerating network events for socket 908
. 2018-05-18 12:32:12.472 Enumerated 18 network events making 18 cumulative events for socket 908
. 2018-05-18 12:32:12.472 Handling network write event on socket 908 with error 0
. 2018-05-18 12:32:12.472 Handling network connect event on socket 908 with error 0
. 2018-05-18 12:32:12.472 Looking for network events
. 2018-05-18 12:32:12.909 Detected network event
. 2018-05-18 12:32:12.909 Enumerating network events for socket 908
. 2018-05-18 12:32:12.909 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:12.909 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:12.909 Server version: SSH-2.0-Serv-U_15.1.5.10
. 2018-05-18 12:32:12.909 Using SSH protocol version 2
. 2018-05-18 12:32:12.909 Have a known host key of type dss
. 2018-05-18 12:32:12.909 Using Diffie-Hellman with standard group "group14"
. 2018-05-18 12:32:12.909 Doing Diffie-Hellman key exchange with hash SHA-1
. 2018-05-18 12:32:13.018 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:13.018 Looking for incoming data
. 2018-05-18 12:32:13.018 Looking for network events
. 2018-05-18 12:32:13.393 Detected network event
. 2018-05-18 12:32:13.393 Enumerating network events for socket 908
. 2018-05-18 12:32:13.393 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:13.393 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:14.001 Host key fingerprint is:
. 2018-05-18 12:32:14.001 ssh-dss 2048 0f:63:26:75:f8:39:51:9f:92:e6:02:b7:85:22:11:b7 vlNnBPY9WEqNe2euxFbxo0EBrhfldzzpr9wSqPbBpCI=
. 2018-05-18 12:32:14.001 Verifying host key dss 0xa4d3a8175e874012 93b08612c99aca55 0174ee2931b16aaf c0fa47d88f98a95f 745dc55545d29cf8 1d27215bba1815c2 a9f7582ed2bc6a1b 6d1fd871c6a31a47 c3f4fed31be65ef5 730da50c0b4ed10e 00f5647f47cb47a9 aae091420b85c7b9 dee5263789f02edd f4d98a98af47f706 17e76b8ff44d3194 2a49796d7dfdde71 8ba6839cec1525e4 59668f01c421f8eb 57e591b4579ec4c1 6cb2b150a8c0eadf bf1d1be753a24b12 d6274244dcdf995b 2f727d0193c8fb1e 84e14abd79aec88a 12c5f4751133ab01 17fb872fecbc011e b9942b939694d328 b06816990a2e8be4 540ab578c224af54 14cdcdf9f3e50788 c27c8880fdaf400d 48871a07bfa0e513 ,0xcf6c63601f0f60b0 18a8b5c8181736ad cf4cdec9,0x4d3158a33f8b1991 bb199cbeb55a91ea 8055558a4e7704a3 c962032c6a1491a5 03cb622f93c5cd97 d57c72b595e60f7e 59589e8278363b88 43c5ea7a87393b11 0e944dd8ee2a0522 0784a0162c1a2c40 a0391d0510c3e2b2 0e965e453352542c 3441ce8894130075 3350177d1da32488 744c686f6d6e795b 97ecb8d53c4c8617 7679108dc9b2e312 9e8825ea036f9ba6 fa3d455c69427318 6fb9cd3c25acc275 99579bfbb12c437b 56ad0e80253828e8 2b7fda811a976b53 65de9906a565e83d f4997dce1ca45bf3 501a1ca14bc79513 4bf2742a12fd17f2 808e36143a8b2042 365bbd6561203948 eb9d0b3d3a54412c 97bf163b4dde759b c1ce2c6d530fb9cf ,0x1f009a492fcad2af 7beb484c5e9a53a5 b92efd107e7c8979 047836266d6b61fd 9c68f8655872cf0d 2e680c6de3b2b119 4610cfd8a31893bc 35fd72975120d0fc 4827f967d4e23cdb 5b4affd6f522f8c0 feb7347cac194e5f 24568df669abd68e 873c10baf1222934 9939296d4fd2ad4f 88824bdf1586b2e3 472e24ca38bf4140 531f5cdd858affc5 42c14858e271410a eb1ebef5b6c2e1ce 113025f1d218d8cf de61517826d87f64 b068585b7367830a 6ed055789be82ca3 7784834d9bd30428 3ea582d6b97b4472 134164a4b03cd975 a24af44b14cab46d 9ba5a12f45ca070b d28aff675396a863 fad1e319d1d223c4 59e9916d3bb0aa36 09c047147c2dee95 with fingerprints ssh-dss 2048 0f:63:26:75:f8:39:51:9f:92:e6:02:b7:85:22:11:b7 vlNnBPY9WEqNe2euxFbxo0EBrhfldzzpr9wSqPbBpCI=
. 2018-05-18 12:32:14.001 Host key matches cached key
. 2018-05-18 12:32:14.001 Selecting events 63 for socket 908
. 2018-05-18 12:32:14.001 Initialised AES-256 SDCTR client->server encryption
. 2018-05-18 12:32:14.001 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2018-05-18 12:32:14.001 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:14.001 Looking for incoming data
. 2018-05-18 12:32:14.001 Looking for network events
. 2018-05-18 12:32:14.001 Detected network event
. 2018-05-18 12:32:14.001 Enumerating network events for socket 908
. 2018-05-18 12:32:14.001 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:14.001 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:14.001 Initialised AES-256 SDCTR server->client encryption
. 2018-05-18 12:32:14.001 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2018-05-18 12:32:14.001 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:14.001 Looking for incoming data
. 2018-05-18 12:32:14.001 Looking for network events
. 2018-05-18 12:32:14.453 Detected network event
. 2018-05-18 12:32:14.453 Enumerating network events for socket 908
. 2018-05-18 12:32:14.453 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:14.453 Handling network read event on socket 908 with error 0
! 2018-05-18 12:32:14.453 Using username "MYPROFILE".
. 2018-05-18 12:32:14.453 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:14.453 Looking for incoming data
. 2018-05-18 12:32:14.453 Looking for network events
. 2018-05-18 12:32:14.656 Detected network event
. 2018-05-18 12:32:14.656 Enumerating network events for socket 908
. 2018-05-18 12:32:14.656 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:14.656 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:14.656 Server offered these authentication methods: password
. 2018-05-18 12:32:14.656 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2018-05-18 12:32:14.656 Using stored password.
. 2018-05-18 12:32:14.656 Sent password
. 2018-05-18 12:32:14.656 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:14.656 Looking for incoming data
. 2018-05-18 12:32:14.656 Looking for network events
. 2018-05-18 12:32:14.859 Detected network event
. 2018-05-18 12:32:14.859 Enumerating network events for socket 908
. 2018-05-18 12:32:14.859 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:14.859 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:14.859 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:14.859 Looking for incoming data
. 2018-05-18 12:32:14.859 Looking for network events
. 2018-05-18 12:32:15.327 Detected network event
. 2018-05-18 12:32:15.327 Enumerating network events for socket 908
. 2018-05-18 12:32:15.327 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:15.327 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:15.327 Access granted
. 2018-05-18 12:32:15.327 Opening session as main channel
. 2018-05-18 12:32:15.327 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:15.327 Looking for incoming data
. 2018-05-18 12:32:15.327 Looking for network events
. 2018-05-18 12:32:15.545 Detected network event
. 2018-05-18 12:32:15.545 Enumerating network events for socket 908
. 2018-05-18 12:32:15.545 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:15.545 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:15.545 Opened main channel
. 2018-05-18 12:32:15.545 Waiting for the server to continue with the initialization
. 2018-05-18 12:32:15.545 Looking for incoming data
. 2018-05-18 12:32:15.545 Looking for network events
. 2018-05-18 12:32:16.076 Detected network event
. 2018-05-18 12:32:16.076 Enumerating network events for socket 908
. 2018-05-18 12:32:16.076 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:16.076 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:16.076 Started a shell/command
. 2018-05-18 12:32:16.076 --------------------------------------------------------------------------
. 2018-05-18 12:32:16.076 Using SFTP protocol.
. 2018-05-18 12:32:16.076 Doing startup conversation with host.
> 2018-05-18 12:32:16.076 Type: SSH_FXP_INIT, Size: 5, Number: -1
> 2018-05-18 12:32:16.076 01,00,00,00,06,
. 2018-05-18 12:32:16.076 Sent 9 bytes
. 2018-05-18 12:32:16.076 There are 0 bytes remaining in the send buffer
. 2018-05-18 12:32:16.076 Looking for network events
. 2018-05-18 12:32:16.076 Timeout waiting for network events
. 2018-05-18 12:32:16.076 Waiting for another 4 bytes
. 2018-05-18 12:32:16.076 Looking for incoming data
. 2018-05-18 12:32:16.076 Looking for network events
. 2018-05-18 12:32:16.278 Detected network event
. 2018-05-18 12:32:16.278 Enumerating network events for socket 908
. 2018-05-18 12:32:16.278 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:16.278 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:16.278 Received 76 bytes (0)
. 2018-05-18 12:32:16.278 Read 4 bytes (72 pending)
. 2018-05-18 12:32:16.278 Read 72 bytes (0 pending)
< 2018-05-18 12:32:16.278 Type: SSH_FXP_VERSION, Size: 72, Number: -1
< 2018-05-18 12:32:16.278 02,00,00,00,06,00,00,00,07,6E,65,77,6C,69,6E,65,00,00,00,02,0D,0A,00,00,00,
< 2018-05-18 12:32:16.278 0A,73,75,70,70,6F,72,74,65,64,32,00,00,00,20,00,00,03,3D,00,00,00,17,00,00,
< 2018-05-18 12:32:16.278 00,07,00,00,00,03,00,10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
. 2018-05-18 12:32:16.278 SFTP version 6 negotiated.
. 2018-05-18 12:32:16.278 Server requests EOL sequence "\r\n".
. 2018-05-18 12:32:16.278 Server support information (supported2):
. 2018-05-18 12:32:16.278 Attribute mask: 33D, Attribute bits: 17, Open flags: 7
. 2018-05-18 12:32:16.278 Access mask: 3, Open block vector: 0, Block vector: 0, Max read size: 1048576
. 2018-05-18 12:32:16.278 Attribute extensions (0)
. 2018-05-18 12:32:16.278 Extensions (0)
. 2018-05-18 12:32:16.278 We will use UTF-8 strings as it is mandatory with SFTP version 4 and newer
. 2018-05-18 12:32:16.278 Getting current directory name.
. 2018-05-18 12:32:16.278 Getting real path for '.'
> 2018-05-18 12:32:16.278 Type: SSH_FXP_REALPATH, Size: 11, Number: 16
> 2018-05-18 12:32:16.278 10,00,00,00,10,00,00,00,01,2E,03,
. 2018-05-18 12:32:16.278 Sent 15 bytes
. 2018-05-18 12:32:16.278 There are 0 bytes remaining in the send buffer
. 2018-05-18 12:32:16.278 Looking for network events
. 2018-05-18 12:32:16.278 Timeout waiting for network events
. 2018-05-18 12:32:16.278 Waiting for another 4 bytes
. 2018-05-18 12:32:16.278 Looking for incoming data
. 2018-05-18 12:32:16.278 Looking for network events
. 2018-05-18 12:32:16.481 Detected network event
. 2018-05-18 12:32:16.481 Enumerating network events for socket 908
. 2018-05-18 12:32:16.481 Enumerated 1 network events making 1 cumulative events for socket 908
. 2018-05-18 12:32:16.481 Handling network read event on socket 908 with error 0
. 2018-05-18 12:32:16.481 Received 96 bytes (0)
. 2018-05-18 12:32:16.481 Read 4 bytes (92 pending)
. 2018-05-18 12:32:16.481 Read 92 bytes (0 pending)
< 2018-05-18 12:32:16.481 Type: SSH_FXP_NAME, Size: 92, Number: 16
< 2018-05-18 12:32:16.481 68,00,00,00,10,00,00,00,01,00,00,00,01,2F,00,00,03,BD,02,00,00,00,00,00,00,
< 2018-05-18 12:32:16.481 00,00,00,00,00,04,75,73,65,72,00,00,00,05,67,72,6F,75,70,00,00,41,FF,00,00,
< 2018-05-18 12:32:16.481 00,00,59,B9,90,17,3A,59,E2,70,00,00,00,00,59,B9,8F,F0,0E,93,05,CC,00,00,00,
< 2018-05-18 12:32:16.481 00,59,B9,90,1A,36,A0,8B,C0,00,00,00,00,00,00,00,F7,
. 2018-05-18 12:32:16.481 Real path is '/'
. 2018-05-18 12:32:16.481 Startup conversation with host finished.
< 2018-05-18 12:32:16.481 Script: Active session: [1] MYPROFILE@MYIPADDRESS
. 2018-05-18 12:32:16.481 Session upkeep
. 2018-05-18 12:32:16.481 Looking for network events
. 2018-05-18 12:32:16.481 Timeout waiting for network events
> 2018-05-18 12:32:16.481 Script: cd /Outbox
> 2018-05-18 12:32:16.481 Script: Parameter: /Outbox
. 2018-05-18 12:32:16.481 Cached directory change via "/Outbox" to "/Outbox".
. 2018-05-18 12:32:16.481 Getting current directory name.
< 2018-05-18 12:32:16.481 Script: /Outbox
. 2018-05-18 12:32:16.481 Session upkeep
. 2018-05-18 12:32:16.481 Looking for network events
. 2018-05-18 12:32:16.481 Timeout waiting for network events
> 2018-05-18 12:32:16.481 Script: exit
. 2018-05-18 12:32:16.481 Session upkeep
. 2018-05-18 12:32:16.481 Looking for network events
. 2018-05-18 12:32:16.481 Timeout waiting for network events
. 2018-05-18 12:32:16.481 Script: Exit code: 0
. 2018-05-18 12:32:16.481 Script: Max roundtrip: 0
. 2018-05-18 12:32:16.481 Closing connection.
. 2018-05-18 12:32:16.481 Sending special code: 12
. 2018-05-18 12:32:16.481 Sent EOF message
. 2018-05-18 12:32:16.481 Selecting events 0 for socket 908

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,286
Location:
Prague, Czechia

Re: Exit command doesn't work

The log file looks all good.
So if you add echo foo after winscp.com, you won't see foo being printed on the console?

Reply with quote

Advertisement

You can post new topics in this forum