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

Sorry Martin, I mistakenly thought that VBA.Shell returned the Exit code, but now I understand it returns the Process ID.
martin

Sorry, I do not know what "shell" do you mean.
LeighWardle

Hi Martin,

One more thing, when mkdir aborted, the 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.

Is there a fix for this?
Thanks,

Leigh
LeighWardle

Thanks, Martin.
LeighWardle

Behaviour of mkdir if folder already exists?

Hi all,

I am using this Script:
open ftp://mincad:redacted.redacted.redacted.redacted -explicitssl -passive=on
mkdir "/root/folder"
cd "/root/folder"
put "c:\localfolder\file.exe" "file.exe"
exit

It works fine when the /root/folder does not exist, but if it does exist, I get a fatal error:
Here is the excerpt from the log:
> 2024-06-03 17:11:04.951 Script: mkdir "/root/folder"
. 2024-06-03 17:11:04.951 Creating directory "/root/folder".
> 2024-06-03 17:11:04.951 CWD /root
< 2024-06-03 17:11:04.966 250 CWD command successful
> 2024-06-03 17:11:04.966 MKD folder
< 2024-06-03 17:11:04.982 550 folder: File exists
. 2024-06-03 17:11:04.982 Asking user:
. 2024-06-03 17:11:04.982 Error creating folder '/root/folder'. ("folder: File exists")
< 2024-06-03 17:11:04.982 Script: Error creating folder '/root/folder'.
< 2024-06-03 17:11:04.982 Script: folder: File exists
. 2024-06-03 17:11:04.982 Answer: Abort
. 2024-06-03 17:11:04.982 Script: Failed
. 2024-06-03 17:11:04.982 Script: Exit code: 1
. 2024-06-03 17:11:04.982 Disconnected from server

Hope it's any easy fix.

Regards,
Leigh