Topic "Command Line usage- default response"

Author Message
jsherk
[View user's profile]

Joined: 2010-07-05
Posts: 35
Location: United States
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
Advertisements
jsherk
[View user's profile]

Joined: 2010-07-05
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Still, this would not upload "New/Updated files only". You should better use "synchronize remote" instead of "put"
_________________
Martin Prikryl
jsherk
[View user's profile]

Joined: 2010-07-05
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
vishal marne

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
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:
http://winscp.net/eng/docs/guide_schedule
_________________
Martin Prikryl
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