Command Line usage- default response

Advertisement

jsherk
Joined:
Posts:
35
Location:
United States

Command Line usage- default response

Hi

I am writing a DOS batch file that will upload a specific file to the remote server. I can call the batch file and the following line successfully runs:
winscp.exe sftp://user@mydomain.com /home/domain/dir/ /upload c:\dir\myfile.txt

The problem I have is that I want to automate the script for unattended automation but it will open the gui window and prompt me to select/check the box marked "New/Updated files only" and then I have to click the "Copy" button.

I have been reading the docs, and tried /defaults and using winscp.com but I must be missing something because I cannot figure out how to automatically tell it that I want "New/Updated files only" CHECKED and then to go ahead and automatically copy.

Any help or suggestions appreciated.

Thanks

Reply with quote

Advertisement

jsherk
Joined:
Posts:
35
Location:
United States

Well I am not sure when the correct place to use winscp.exe versus winscp.com but this is what I ended up doing, which seems to work:

From the DOS command line I call:
winscp.com /script=myscript.txt /parameter "path/to/remoteDir" "path\to\localDir" "localFilname"

myscript.txt looks like this:
open sftp://user@mydomain.com
cd %1%
option batch on
option confirm off
put -resume %2%\%3%
exit

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Still, this would not upload "New/Updated files only". You should better use "synchronize remote" instead of "put"
_________________
Martin Prikryl

Reply with quote

jsherk
Joined:
Posts:
35
Location:
United States

Oh yeah, that would be better.

And it appears that I do need the "option batch" or "option confirm" when doing this either, as that would implied.

Thanks

Reply with quote

vishal marne
Guest

Need to transfer XML file on Sftp server

Hi prikryl,

i need to upload xml file on secure FTP location using winscp.com. it is a backend activity it should get executed in Timer Job.How i can achive this.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Need to transfer XML file on Sftp server

vishal marne wrote:

i need to upload xml file on secure FTP location using winscp.com. it is a backend activity it should get executed in Timer Job.How i can achive this.
Please read documentation:
https://winscp.net/eng/docs/guide_schedule
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum