PSFTP/PSCP: remotely deleting directory recursively

Hello,

I'm looking for a way to use PSFTP or PSCP, executed from a batch file in Windows, to delete an entire folder and its contents. I can run a script using PSFTP which can use rm or rmdir, but the -rf command doesn't work. Any suggestions on another client to use in the same context, or a workaround (aside from going through and deleting all subfiles using del /dir/*).

Forgive me if I'm not very knowledgable.

Those aren't shells. scp copies, sftp handles commands normal FTP does, that's it; "rm -rf" means nothing to them.

If you want to run things on the server, try plink, that does actual shell logins.

1 Like

That makes sense, thanks.

EDIT: I've figured it out. Thanks for your help!