Topic "Need a step by step for a newbie"

Author Message


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:

// 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 = "";
// Path to
var WINSCP = "c:\\program files (x86)\\winscp\\";

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!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24755
Location: Prague, Czechia
You have to run the cscript ... command on Windows command-line (cmd.exe).

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License