Ok, then indeed the code linked by @Mister H is helpful.
Or see similar Using VBA to run WinSCP script or Microsoft's take on the topic: Determine when a shelled process ends
But! WinSCP does not return "SFTP codes". It returns
See How do I know that script completed successfully?
Once you check the exit code only, you do not need the batch file at all. It becomes unnecessary overhead/complication. Run
Or see similar Using VBA to run WinSCP script or Microsoft's take on the topic: Determine when a shelled process ends
But! WinSCP does not return "SFTP codes". It returns
0
for success and 1
for error.
See How do I know that script completed successfully?
Once you check the exit code only, you do not need the batch file at all. It becomes unnecessary overhead/complication. Run
winscp.com
directly and check its exit code.