Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

LeighWardle

Re: Seeking VBA code to capture WinSCP Script Exit code when Shell function always returns 0

Thanks, Martin; I mistakenly thought that VBA.Shell returned the Exit code, but now I understand it returns the Process ID.
Your suggestion, VBA Shell and Wait with Exit Code, solves my issue.
martin

Re: Seeking VBA code to capture WinSCP Script Exit code when Shell function always returns 0

That looks like VBA question, rather than WinSCP question.
Would this help?
VBA Shell and Wait with Exit Code
LeighWardle

Seeking VBA code to capture WinSCP Script Exit code when Shell function always returns 0

Hi everyone,

I am calling a WinSCP script from VBA code, invoking WinSCP from the Shell function.

In my testing, I had an example for which mkdir aborted.
For this case, the WinSCP log shows the Exit code: 1.
. 2024-06-03 17:11:04.982 Script: Failed
. 2024-06-03 17:11:04.982 Script: Exit code: 1

But Shell returned the error code = 0.

I want to make my code bullet-proof, so I am looking for code to capture the WinSCP Exit code?

Thanks, Leigh