Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Elwood

Yes I can. It's just one more scan of the root directory, whereas WinSCP already scans this directory when using synchronize, so it could be more elegant if WinSCP could do it.
But I see now that it's not even intended in the API (https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilew).

So I'll do it myself.

I then suggest to add a note in the description of the -delete switch (https://beta.winscp.net/eng/docs/scriptcommand_synchronize), unless you want to answer such question again by someone else :-P

Thanks to all.
Elwood

Damn! You are right.
I am so surprised I can't delete this file from an MSDOS script, even if I run it as the domain administrator!

So as I want to fully understand, I spent some time on this and I found what blocks the file deletion. This is because the file has the ReadOnly attribute (you can see it on the Properties window, first tab).
So in MSDOS, using del myfile is not enough, you need to use del /F myfile.

So how can I do the equivalent with WinSCP? Any "-forcedelete" option? Or just "really delete" as it's what it is supposed to do anyway :-p

Thanks