Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Need a step by step for a newbie

You have to run the cscript ... command on Windows command-line (cmd.exe).

Need a step by step for a newbie

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!