Cannot get scripts to run

Advertisement

none
Guest

Cannot get scripts to run

I have a Windows server I that want to automatically get a file from a Linux SSH server every night.

I have installed WinSCP3 on my Windows server and have it working fine with public Key & Pageant to my unix ssh server using the GUI interface.

Next I put this in a script named script.txt:
option batch on
option confirm off
open mrtest@10.1.1.10
option transfer ascii
get /home/mrtest/xfer/junk c:\trans\junk
close
exit
I try running the script from command line like this:
WinSCP3 /console /script=script.txt
But it brings up the GUI and does not do the file transfer.

How do I make this work each night in automated fashion?

Reply with quote

Advertisement

edernest
Guest

Re: Cannot get scripts to run

You need to run winscp3.com, not the .exe. If you are using a Scheduled Task, you should specify the .com like this:
"C:\Program Files\WinSCP3\winscp3.com" /console /script=script.txt
Make sure you put the arguments _outside_ of the quoted path to the program. This advice applies to Windows built in Scheduled Tasks, but if you are seeing the GUI open up, you are most likely executing the .exe.

Reply with quote

none
Guest

Re[2]: Cannot get scripts to run

Thanks - where do I get winscp.com? - it did not come with the sourceforge install (for Windows) I am using...

Reply with quote

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

Re: Cannot get scripts to run

none wrote:

I try running the script from command line like this:
WinSCP3 /console /script=script.txt
But it brings up the GUI and does not do the file transfer.
The command is correct. I have just tried it with the same script.txt file and the same parameters. New console window is opened and WinSCP tries to connect (what naturally fails).

What version of WinSCP are you using?

you need to run winscp3.com, not the .exe.
This is not true. You do not need .com as long as you do not need to run WinSCP from other console application and as long as you use /console parameter (with .com it is used automatically). Read more in documentation.

Reply with quote

Advertisement

You can post new topics in this forum