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

danp306

Getting closer...

Hi Martin,

Thanks so much for your help. I'll gladly donate $$ for your help.

I did get to at least get logged into the site, but it's not recognizing the public key.

Please see the attached screenshot. Any ideas?

Thanks again
Dan
martin

Re: Can't get script to work using a public key

You have two problems.

  • You are obviously trying to run new_file.cmd directly as if it were a Windows batch file, instead of via winscp.com (contrary to what you claim). Hence the ""open" is not recognized as an internal or external command" error from Windows command interpretter (cmd.exe). So that has nothing to do with any private key.
  • The -o IdentityFile is OpenSSH syntax. It has nothing to do with WinSCP.
    In WinSCP, use -privatekey:
    https://winscp.net/eng/docs/scriptcommand_open#privatekey
    But that will become a problem only after you fix the previous point.
danp306

Can't get script to work using a public key

This is our current command which works fine:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /console /script=current_file.cmd

Current_file:
open sftp://bpxxxxxx:yxx=MxxP@sftp-uat-us.aciondemand.com:22/

We are using a public key with our new connection. I can't get it to work via a script file:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /console /script=new_file.cmd

new_file:
open sftp -o IdentityFile="c:\winscp_pk\convertsshuat" bpxxxxxx@sftp-uat-us.aciondemand.com

I get the following error:
"open" is not recognized as an internal or external command

If I take out the open and just try sftp I get:
"sftp" is not recognized as an internal or external command

Is it a problem using a script with a public key?

Any help would be appreciated.

Thanks
Dan