Topic "Cannot get scripts to run"

Author Message
none

Guest


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?
Advertisements
edernest

Guest


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
none

Guest


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

Guest


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/
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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?

Quote:
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.
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License