Topic "Need a step by step for a newbie"

Author Message
K

Guest


Can anyone point me to a good step by step for someone who is completely new to scripting? I am trying to duplicate the script to download the most recent file jscript example. I have put in my information in the top section:

Code:
// Local path to download to (keep trailing slash)
var LOCALPATH = "c:\\sftptest\\";
// Remote path to search in (keep trailing slash)
var REMOTEPATH = "/in/";
// Mask of files to search for
var FILEMASK = "*.*";
// Session to connect to
var SESSION = "username@address.sftp.gov";
// Path to winscp.com
var WINSCP = "c:\\program files (x86)\\winscp\\winscp.com";


I left everything else exactly the same.

I saved the file as sftp.js and put it both in the winscp program folder and on in the current directory on the sftp site. Then I opened my session in winscp, opened console and typed:

cscript /nologo sftp.js

I get an error "Command 'cscript /nologo sftp.js' failed with return code 127 and error message -bash: line 11: cscript:command not found.

--------------------
What I am trying to do is to download the most recent file on the server, ultimately I want to create a batch file to do all this. I need a step-by-step guide please!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
You have to run the cscript ... command on Windows command-line (cmd.exe).
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