How to compress a directory with WinSCP using SCP protocol

How to compress a directory with WinSCP using SCP protocol

Here is the command I wrote to tar and gzip a directory. It does not delete the original directory. It prompts the user for the archive name, an exclusion pattern (can be blank) and a directory or filename to compress. You must be using SCP protocol for custom shell commands as SFTP doesn't allow it. You can add this as a custom command: