How to automatically answer the overwrite message

Advertisement

lewis@pepperit.com
Joined:
Posts:
2
Location:
Derby

How to automatically answer the overwrite message

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

Reply with quote

Advertisement

lewis@pepperit.com
Joined:
Posts:
2
Location:
Derby

Overwriting

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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Overwriting

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.

Reply with quote

Kevin Chan
Guest

Just encountered same issue I found that using confirm option can disallow the prompt for overwrite file.
Share here for others.


option batch on #enables batch mode. In batch mode, any choice prompt is automatically replied and any input prompt is cancelled (after short time interval).
option confirm off #set confirm to off to allow overwrites

Reply with quote

Advertisement

You can post new topics in this forum