Post a reply

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

Jayp

Hmmm

Well after looking everywhere for a possible cause I decided to do something which I should have done to begin with!
I put a pause in the cmd script so I could see the output from the command prompt.
winscp3.com is not a recognised file.
oops! where did I get the 3 from?
Changed to winscp.com and all works perfectly now
Jayp

Re: Still no go

I'm (now) using the .com that is in the same folder as the exe. The version of the exe is 5.1.1 build 2735.
I can't see a way to determine the version of the .com but as it's in the same install folder I assume it's the latest.

I have changed my 2 files to be:
CD "C:\T1\NDD\"
winscp3.com /console /script="C:\T1\NDD\NDD_SSH.txt" /log="C:\T1\NDD\log\&Y&M&D&T&S.log"
move "C:\T1\NDD\NDD XML output\*.xml" "C:\T1\NDD\NDD XML output\complete\"
exit

and
option batch abort
open <hidden> -hostkey="ssh-rsa 2048 86:17:7e:96:8d:22:22:dd:7c:98:f7:35:31:9c:37:98"
ls *.*
lcd "C:\T1\NDD\NDD XML Output"
put *.xml
ls *.*
close
exit


Still no success. No logging. No files received at remote end. Files ARE transferred locally to the "complete" folder
martin

Re: Still no go

Jayp wrote:

Thanks, still missing something and not sure why.
The sceduled task runs and fires up the script, connection is made (assumption), transfer does NOT happen and the local files are then moved to the completed folder. Nothing is logged so I cannot see what is not happening.

Run WinSCP.cmd
CD "C:\T1\NDD\"
winscp3.exe /console /script="NDD_SSH.txt" /log="log/&Y&M&D&T&S.log" /open <removed for privacy>
move "C:\T1\NDD\NDD XML output\*.xml" "C:\T1\NDD\NDD XML output\complete\"
exit

NDD_SSH.txt
option batch abort
open <removed for privacy> -hostkey="ssh-rsa 2048 86:17:7e:96:8d:22:22:dd:7c:98:f7:35:31:9c:37:98"
ls *.*
lcd "C:\T1\NDD\NDD XML Output"
put *.xml
ls *.*
close
exit


logging window screenshot attatched

1) winscp3.exe suggests you might be using an ancient version of WinSCP (thought the screenshot looks quite new). So first, make sure you get the latest one.
2) Use winscp.com, not winscp.exe.
See why: https://winscp.net/eng/docs/executables
3) Better use full path with /log and backslashes, not slashes (it's local path!)
4) There's no /open command-line parameter. And it seems redundant to open command in the script anyway, please remote it.
Jayp

Still no go

Thanks, still missing something and not sure why.
The sceduled task runs and fires up the script, connection is made (assumption), transfer does NOT happen and the local files are then moved to the completed folder. Nothing is logged so I cannot see what is not happening.

Run WinSCP.cmd
CD "C:\T1\NDD\"
winscp3.exe /console /script="NDD_SSH.txt" /log="log/&Y&M&D&T&S.log" /open <removed for privacy>
move "C:\T1\NDD\NDD XML output\*.xml" "C:\T1\NDD\NDD XML output\complete\"
exit

NDD_SSH.txt
option batch abort
open <removed for privacy> -hostkey="ssh-rsa 2048 86:17:7e:96:8d:22:22:dd:7c:98:f7:35:31:9c:37:98"
ls *.*
lcd "C:\T1\NDD\NDD XML Output"
put *.xml
ls *.*
close
exit


logging window screenshot attatched
Jayp

Run silently

No doubt this is a FAQ somewhere but I can't find it sorry.
I have inherited a windows scheduled task that runs Winscp - I know have to transfer this to a new server.
I've followed as much as I can to recreate the environment but I can't get past this bit. It seems the connection is asking me to select yes/no/cancel at some stage during the automation and I'm not sure how to get rid of the prompts.
The log says...

If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
Continue connecting and add host key to the cache? ()

and the task just sits and waits.
I'm not sure how to specify "yes" and have this remembered so that the task can run silently.
I'm using version 3.8.2