Post a reply

Options
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)

Options

Topic review

martin

Re: How to overwrite prompt with a (Y)es asked while removing a file in winscp.

The rm command does not ask for configuration.

Can you show us a screenshot?
Guest

How to overwrite prompt with a (Y)es asked while removing a file in winscp.

Hi,

I am trying to remove a file in a VM and put a new file with the same name in that directory. But somehow the file is not getting removed. When i tried to remove the file manually it is throwing a prompt asking " remove regular file xxx.xml?". how can I input yes into this prompt when run from bat script.

Below is the code i am using:
"C:\Program Files (x86)\WinSCP\WinSCP.com" username:passwrd@xx.xxx.xxx.xxx "option confirm off" "option batch abort" /command "rm /usr/local/web.xml" "put e:\web.xml /usr/local/web.xml" "exit"

Thanks in advance!!
chrishov

My bad. I was mistaking the prompt for the rm command but it was for a del command in my batch file. Thanks for the quick reply though
martin

Re: Scripting RM and not get prompted

I'm not aware of any prompt with rm command.
Can you post a screenshot?
Chrishov

Scripting RM and not get prompted

Im trying to remove the contents of my root SFTP directory before I upload a new file. Unfortunatly it promts me to say Y or N.

Here is a basic look at what im doing.

# Disable overwrite confirmations that conflict with the previous
option confirm off
# clear contents on SFTP server
rm *
# Upload the file to current working directory
put E:\upload\*.zip

Problem is the option confirm off does not appear to work for the "rm" command

Ive searched the documentaion and have not figured out how to accomplish this. Can anyone point me in the right direction?

Thanks in advacne.
Chris