martin wrote:
Where do you run the command line from? It looks like you run it from some environment that "eats" the backslash. Try to duplicate it:
c:\WinSCP.exe /log=c:\winscp.log /console /command "open tempus:tempusftp@192.168.166.29" "mv ftp c:\\test_bat" exit
I added the extra slash but still denied access. I am running this from windows scheduler. using a domain login and seperate session login.
Here is the log and it has changed the error codes.
. 2008-09-23 12:33:27.362 WinSCP Version 4.1.6 (Build 412) (OS 5.1.2600 Service Pack 3)
. 2008-09-23 12:33:27.362 Login time: Tuesday, September 23, 2008 12:33:27 PM
. 2008-09-23 12:33:27.362 --------------------------------------------------------------------------
. 2008-09-23 12:33:27.362 Session name: tempus@192.168.166.29
. 2008-09-23 12:33:27.362 Host name: 192.168.166.29 (Port: 22)
. 2008-09-23 12:33:27.362 User name: tempus (Password: Yes, Key file: No)
. 2008-09-23 12:33:27.362 Tunnel: No
. 2008-09-23 12:33:27.362 Transfer Protocol: SFTP (SCP)
. 2008-09-23 12:33:27.362 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2008-09-23 12:33:27.362 Proxy: none
. 2008-09-23 12:33:27.362 SSH protocol version: 2; Compression: No
. 2008-09-23 12:33:27.362 Bypass authentication: No
. 2008-09-23 12:33:27.362 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-09-23 12:33:27.362 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2008-09-23 12:33:27.362 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-09-23 12:33:27.362 SFTP Bugs: -,-
. 2008-09-23 12:33:27.362 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-09-23 12:33:27.362 Shell: default, EOL: 0
. 2008-09-23 12:33:27.362 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-09-23 12:33:27.362 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2008-09-23 12:33:27.362 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-09-23 12:33:27.362 Cache directory changes: Yes, Permanent: Yes
. 2008-09-23 12:33:27.362 DST mode: 1
. 2008-09-23 12:33:27.362 --------------------------------------------------------------------------
. 2008-09-23 12:33:27.362 Looking up host "192.168.166.29"
. 2008-09-23 12:33:27.362 Connecting to 192.168.166.29 port 22
. 2008-09-23 12:33:27.440 Server version: SSH-2.0-WeOnlyDo 2.0.6
. 2008-09-23 12:33:27.440 We claim version: SSH-2.0-WinSCP_release_4.1.6
. 2008-09-23 12:33:27.440 SSPI: acquired credentials for: mharper@HUNTERLABORATORIES.COM
. 2008-09-23 12:33:27.440 Cannot convert IP address to SPN: DNS is not trusted
. 2008-09-23 12:33:27.440 GSSKEX disabled: The operation completed successfully.
. 2008-09-23 12:33:27.440 Using SSH protocol version 2
. 2008-09-23 12:33:27.440 Using Diffie-Hellman with standard group "group14"
. 2008-09-23 12:33:27.440 Doing Diffie-Hellman key exchange with hash SHA-1
. 2008-09-23 12:33:27.987 Host key fingerprint is:
. 2008-09-23 12:33:27.987 ssh-rsa 2048 25:a3:ed:57:45:78:e1:7e:3e:ce:9a:36:75:fb:7a:35
. 2008-09-23 12:33:27.987 Initialised AES-256 CBC client->server encryption
. 2008-09-23 12:33:27.987 Initialised HMAC-SHA1 client->server MAC algorithm
. 2008-09-23 12:33:27.987 Initialised AES-256 CBC server->client encryption
. 2008-09-23 12:33:27.987 Initialised HMAC-SHA1 server->client MAC algorithm
! 2008-09-23 12:33:27.987 Using username "tempus".
. 2008-09-23 12:33:27.987 Prompt (6, SSH password, , &Password: )
. 2008-09-23 12:33:27.987 Using stored password.
. 2008-09-23 12:33:27.987 Sent password
. 2008-09-23 12:33:27.987 Access granted
. 2008-09-23 12:33:27.987 Opened channel for session
. 2008-09-23 12:33:27.987 Started a shell/command
. 2008-09-23 12:33:27.987 --------------------------------------------------------------------------
. 2008-09-23 12:33:27.987 Using SFTP protocol.
. 2008-09-23 12:33:27.987 Doing startup conversation with host.
> 2008-09-23 12:33:27.987 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-09-23 12:33:28.175 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2008-09-23 12:33:28.175 SFTP version 3 negotiated.
. 2008-09-23 12:33:28.175 We believe the server has signed timestamps bug
. 2008-09-23 12:33:28.175 We will use UTF-8 strings for status messages only
. 2008-09-23 12:33:28.175 Getting current directory name.
. 2008-09-23 12:33:28.175 Getting real path for '.'
> 2008-09-23 12:33:28.175 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-09-23 12:33:28.206 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2008-09-23 12:33:28.206 Real path is '/'
. 2008-09-23 12:33:28.206 Startup conversation with host finished.
. 2008-09-23 12:33:28.206 Moving file "ftp" to "c:\test_bat".
> 2008-09-23 12:33:28.206 Type: SSH_FXP_RENAME, Size: 29, Number: 274
< 2008-09-23 12:33:28.206 Type: SSH_FXP_STATUS, Size: 34, Number: 274
< 2008-09-23 12:33:28.206 Status/error code: 3, Message: 274, Server: Permission denied, Language:
. 2008-09-23 12:33:28.206 Asking user:
. 2008-09-23 12:33:28.206 Error moving file 'ftp' to 'c:\test_bat'. ("Permission denied.
. 2008-09-23 12:33:28.206 Error code: 3
. 2008-09-23 12:33:28.206 Error message from server: Permission denied
. 2008-09-23 12:33:28.206 Request code: 18")
. 2008-09-23 12:33:52.441 Closing connection.
. 2008-09-23 12:33:52.441 Sending special code: 12
. 2008-09-23 12:33:52.441 Sent EOF message