Topic "How to automatically answer the overwrite message"

Author Message
lewis@pepperit.com
[View user's profile]

Joined: 2013-01-23
Posts: 2
Location: Derby
Hi,

I'm trying to set up an ftp program and i have it working and copying files, however its always prompts to overwrite. What i want is when this screen prompts a bit of code to automatically say no to all overwrites. Hopefully that makes sense my code is below:

option batch abort
option batch off
open serverbackup
put c:\test\*.* /lewis/test/*.* -preservetime
close serverbackup

this is the first part of the script saved in a tmp file.

@echo on
rem WinSCP Server Automated Backup.
rem Created for Quantact.com

rem Settings.

rem Server Login
set session=serverbackup

rem Folder Settings.
set server_folder=/var/www/html/
set local_folder=c:\Server_Backup\Archives\

rem Path to winscp.
set winscp_path=c:\Progra~1\WinSCP3\WinSCP3.com



rem Execute script
%winscp_path% /script=script.tmp %filelog%

rem Delete temporary script
del script.tmp

thats the second part saved as a txt file.


set winscp_path="C:\Program Files\WinSCP\WinSCP.exe"

%winscp_path% /console /script=script.tmp

pause

and that part is saved as a .bat file

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
Please read documentation:
https://winscp.net/eng/docs/guide_automation#commands
https://winscp.net/eng/docs/scriptcommand_option
_________________
Martin Prikryl
lewis@pepperit.com
[View user's profile]

Joined: 2013-01-23
Posts: 2
Location: Derby
Hi,

Iv'e tried looking through them and tried codes with syncronise in it but i still can't get it to work, any help would be appreciated.

cheers
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
For "synchronize" the overwrite confirmations are disabled implicitly.

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
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