No connection to SFTP partner possible via batch script Server 2016

Advertisement

Sandra
Joined:
Posts:
1

No connection to SFTP partner possible via batch script Server 2016

I have to switch our batch scripts from a Windows Server 2008 R2 OS to Windows Server 2016 OS.

WS 2008 RS
WinSCP Version 5.11.2
executable user is log off
The scripts works fine and a connection to an SFTP partner is possible.

WS 2016
WinSCP Version 5.13.7
executable user is log off
The scripts doesn't work: a connection to an SFTP partner isn't possible.

Both scripts starts with windows task scheduler and the option "run whether user is logged on or not" is enable.

script content:
echo Daten an %v_partner% uebertragen >> %v_log%
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script /command ^
"option batch abort" ^
"option confirm off" ^
"open %v_ftp_partner%" ^
"cd %v_ftp_pfad%" ^
"put %v_preserve% %v_transport%*" ^
"exit" /log=%v_log%

the variables are in a separate script which start the main script with this command lines.
in the attachment is the log file.

the connection is set up as an "Ad-Hoc Site" instead of "Site"and gets stuck in: "Looking up host "price" for SSH connection"
price is the name of the connection.

are there any known problems in this constellation o what exactly do I have to change to reestablish the connections?

Thank you.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: No connection to SFTP partner possible via batch script Server 2016

Your script relies in stored site price.
As such it's not portable to another machine.

You have to transfer your WinSCP configuration in Windows registry to the new machine.
https://winscp.net/eng/docs/config#transfer

Or even better change your script not to rely on the stored site.
https://winscp.net/eng/docs/scripting#configuration
If you check a WinSCP log file on the original machine, you will find a suggestion of the correct open command to use. Search for "In scripting you should not rely on saved sites, use this command instead:"

Reply with quote

Advertisement

You can post new topics in this forum