Batch - WinSCP Scripts are not working

Advertisement

venkata.srt.tcs@...
Guest

Batch - WinSCP Scripts are not working

Hi All,

We are trying the option of synchronizing the folder local directory to the SFTP directory.
Here is the script file details
option batch abort
option confirm off
open sftp://xx_xx@xx.co.net.xx/ -hostkey="ssh-rsa 2048 OZmbfQXMfIAAkZ/08lzjZTIbFOhnEz7+UY3lhJHpst8=" -privatekey="D:\XXX\Key File Shared\XXXprivate key.ppk" -passphrase="XXX1234" -rawsettings ProxyMethod=3 ProxyHost="10.00.00.00" ProxyUsername="SVC_XXX" ProxyPassword="FUg7sT5kVX5Om9"
synchronize remote "D:\XXX\DATA" /XX_XXXX_SFTP
exit
When I run the script in the Command Mode (CMD) it is working perfectly.
Here is the command
C:\Program Files (x86)\WinSCP>winscp.com /script="D:\XXX\SyncToRemoteXXXScript.txt"
When we use the same command on the batch File
winscp.com /script="D:\XXX\SyncToRemoteXXXScript.txt"
pause

I hope the issue is not able find the WinSCP command, so unable to execute the batch File.

Can you please help.

Regards,
Venkat

Reply with quote

Advertisement

Venkata
Joined:
Posts:
1

Re: Batch - WinSCP Scripts are not working

Tried to change the .BAT File based on the recommendation in other messages
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="D:\XXX\Setup - WinSCP\Auto\WinSCP.log" /ini=nul /script="D:\XXX\SyncToRemoteXXXScript.txt"
Get the error message:
Proxy error: 403 Forbidden
Attaching the Logfile & Script File.
  • WinSCP.log (4.42 KB, Private file)
  • SyncToRemoteNBNScript.bat (139 Bytes, Private file)

Reply with quote

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

Re: Batch - WinSCP Scripts are not working

How do you run your batch file? It looks like you are running it by some service account. I assume the account is not authorized to your proxy server.

Reply with quote

Guest

Re: Batch - WinSCP Scripts are not working

Hi Martin,
Running though WinSCP GUI it was working absolutely fine.
Once I created the script and schedule in the Task Scheduler I am getting this error message.
Now the Winsock GUI is also not working.
Error message:
proxy:403 forbidden.
I checked in another system it was working fine with WinSCP GUI.

I think it is not releasing the session or cache after executing the batch file.

Tried to clear the all data and created a fresh still the same problem.

I am really struck at this time.since we are not able to automate the process.


Regards,
Venkat

Reply with quote

martin
Site Admin
martin avatar

Re: Batch - WinSCP Scripts are not working

You should contact your local network administrator. We cannot help you with an authentication to your proxy server.

Reply with quote

Advertisement

guest77
Guest

script

Set at the Windows Path and Environment the location of the WinSCP.com in order to be run from any folder.

Reply with quote

Advertisement

You can post new topics in this forum