apologies - I don't have a fully working sample available (or time to put one together I am afraid), but maybe else could put one together for you.  You might get further if you share the code you have so far which is using these two components and explain the specific issues you are seeing (your original post wasn't clear that you already had the appropriate components in-hand but were having issues using them correctly)

@Hiroshi Sato - thank you for sharing!

I would recommend that rather than using $zf(-100) you use the %File class to make your directory creation OS-independent.  This will allow it to be used on different OSes.

Check out the CreateDirectoryChain() method of the %File class:

https://docs.intersystems.com/iris20231/csp/documatic/%25CSP.Documatic.c...

So your line "Set x=$ZF(-100, "/shell", "mkdir", Directory)" could be replaced by:

Set x=##class(%File).CreateDirectoryChain(Directory,.return)
If ('x) {
  Write "Error Creating Directory Chain: "_return
}

Also, make sure that this script runs as the user that is used for all IRIS processes to ensure that the directory has appropriate ownership and permissions

HTH!

Thank you @Matthew Giesmann !!  I know a lot of work went into this effort, and that our beta testers have been using this successfully for many months.  

Everyone - please make sure to provide feedback, especially if you see any issues.  After a period of dual-use we will be retiring the old UI completely so if there are reasons users need to keep using the old UI for some reason we need to hear about the details ASAP.