Topic "Network error: Connection timed out - only when calling from a different machine"

Author Message
[View user's profile]

Joined: 2016-08-11
Posts: 1
Location: Tulsa, OK USA

I'm using WinSCP version 5.8.4 RC (Build 6736). WinSCP is installed on SERVERXYZ.
I'm using the sftp protocol and am calling a XrayTest.bat file to do my file transfer. If I call XrayTest.bat from a command prompt of SERVERXYZ via UNC path, ex: C:\> \\SERVERXYZ\share\folder\XrayTest.bat then the batch file and script runs successfully and transfers the files to the remote location as expected.

However, when issuing the same UNC call from a different machine: CLIENTPC C:\> \\SERVERXYZ\share\folder\XrayTest.bat, the .bat file executes and runs the script, but WinSCP fails with a timeout when trying to connect to the remote server. Here is the log excerpt:
. 2016-08-11 14:21:26.385 --------------------------------------------------------------------------
. 2016-08-11 14:21:26.397 Looking up host "" for SSH connection
. 2016-08-11 14:21:26.430 Connecting to port 22
. 2016-08-11 14:21:47.413 Failed to connect to Network error: Connection timed out
. 2016-08-11 14:21:47.544 Knocking FTP port.
. 2016-08-11 14:21:47.667 FTP port opened, will suggest using FTP protocol.

Here are the commands in the XrayTest.bat file:
rem *** create parameter variables for WinSCP call
set "imagefile=\\SERVERXYZ\share\folder\%imagefile%"
set "depositfile=\\SERVERXYZ\share\folder\%depositfile%"

rem *** Call WinSCP to transfer the files, writing log file.
"\\SERVERXYZ\share\folder\WinSCP\" /log="\\SERVERXYZ\share\folder\WinSCP\winscp.log" /loglevel=1 /script="\\SERVERXYZ\share\folder\script.txt" /parameter %imagefile% %depositfile% >> "\\SERVERXYZ\share\folder\FTPLog.txt"

Here is the script.txt file:
option batch abort
option confirm off
option transfer binary
open s -hostkey="ssh-rsa 2048 cb:e9:b9:a5:a3:b9:e6:16:c9:18:2a:dc:a2:8a:b4:ba"
put -nopermissions -nopreservetime %1%
put -nopermissions -nopreservetime %2%

Any help is appreciated on why this works when called on the local machine, but fails when called from a remote machine with the UNC path. Let me know if I missed supplying a pertinent piece of information

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You probably have a Windows local policy in place, that prevents an application, run from a network location, to access an Internet/network.

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License