Cannot get scripts to run

Advertisement

none
Guest

Cannot get scripts to run

I have a Windoze server I that want to automatically get a file from a linux ssh server every night.

I have installed WinSCP3 on my windoze 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

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.

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


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 window's 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

edernest
Guest

Re: Re[2]: Cannot get scripts to run

none wrote:

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


Then, you need to get yourself a new download.

https://winscp.net/

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,477
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