Scripting RM and not get prompted

Advertisement

Chrishov
Guest

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

Reply with quote

Advertisement

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

Re: Scripting RM and not get prompted

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

Reply with quote

chrishov
Guest

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

Reply with quote

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!!

Reply with quote

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

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?

Reply with quote

Advertisement

You can post new topics in this forum