Custom commands are shell commands. Not WinSCP commands.
If you want to use WinSCP commands, you have to execute WinSCP (another instance) in a custom command to execute your WinSCP commands.
This is covered here:
https://winscp.net/eng/docs/guide_custom_commands_automation
If you want to use WinSCP commands, you have to execute WinSCP (another instance) in a custom command to execute your WinSCP commands.
This is covered here:
https://winscp.net/eng/docs/guide_custom_commands_automation