Q:

Delete folders with many files quickly in WinSCP

In WinSCP, if I select a directory and right-click to delete, instead of simply deleting the directory it deletes all the contents one at a time. Depending on the contents and the connection, this can take a very long time.
Is there any way, within the WinSCP interface, I can simply delete a directory as quickly as if I'd used a command like rm -rf?

A:

This is based on the WinSCP "Useful commands" page entry for "delete" with some important missing steps added.
These steps you only need to do once:

Right-click some test directory to delete
Choose Custom commands > Customize
Click the "Add" button
Under "Description" give it a name of your choice, like "Delete"
Under "Custom command" you have a choice:

Do you want a confirmation box to pop up? If so, enter: test "!?Do you really want to delete ?no!" == "yes" && rm -rf !&
Do you want it to just instantly delete? If so, enter: rm -f -r "!"

Tick the "Apply to directories" checkbox
Hit "Okay". You now have a "Delete" option under "Custom commands" any time you right-click a file or folder.

You can now delete any file or folder instantly with this new custom command. It might take a few seconds to reconnect the first time you do this in a session

