Problem with command line utility in file context menu

I'm using this code to run command line utility to work on images (/utils is my folder alias):

/utils/ImageMagick/convert -border "20" -bordercolor "#FFF" -gravity center +append {allfile$} output.png 

It works fine in all cases when entered in command field (CLI QUICKCMD). But when I use file type dialog to set up a context menu to run this command on selected images, I get this error (I use @leavedoswindowopen to see the error):

The system cannot find the path specified.
convert: UnableToOpenBlob '2018-01-08 15.06.16.jpg': No such file or directory @ error/blob.c/OpenBlob/3323.
convert: UnableToOpenBlob '2018-01-08 15.20.19.jpg': No such file or directory @ error/blob.c/OpenBlob/3323.
convert: NoImagesDefined `output.png' @ error/convert.c/ConvertImageCommand/3275.

This happens only when the path (folder name) contains non-ASCII characters, like ółż (ASCII-only folder names work ok) and only when invoked by context menu (command bar works ok).

Why is there even a difference between those two methods and how can I fix this?

v 12.8 x64

Does it work if you set the command type to Standard Function instead of MS-DOS Batch?

I tried both and none worked.

That's weird but now I came home and on my home computer the same command works fine from context menu.

Folder name is the same. File names and files contents are the same. Command is the same. DOpus version is the same. Windows version is different (7 Pro at home and 10 at work).

Any ideas? Is there a way to see the exact command that was passed to the exe file?

Replace /utils/ImageMagick/convert with dopusrt /ArgsMsgBox

If you're using {allfile$} and not {allfilepath$}, you might need to add a line with cd {sourcepath$} before the command.

Now I tried it at work and am still having issues.

Params are the same. I think there's something wrong with paths. I tried adding cd cd {sourcepath$} but no luck.

When the command is finished, current dir in dos window is c:\windows\system32, instead of the one that was used as source. Is that normal?

I tried to switch to paths instead of file names /utils/ImageMagick/convert -border "20" -bordercolor "#FFF" -gravity center +append {allfilepath$} output.png but now I'm getting this error:

The system cannot find the path specified.
convert: UnableToOpenBlob 'C:\Users\[...]\a ólz\2018-01-08 15.20.19.jpg': No such file or directory @ error/blob.c/OpenBlob/3323.
convert: UnableToOpenBlob 'C:\Users\[...]\a ólz\2018-01-08 15.06.16.jpg': No such file or directory @ error/blob.c/OpenBlob/3323.
convert: NoImagesDefined `output.png' @ error/convert.c/ConvertImageCommand/3275.

Note that polish letters are changed to some weird chars.

Edit: original folder name was a ółż

Is the right command line being generated? Maybe that version/build of imagemagick doesn't take unicode names via the command line or something?

DOS-Batch can complicate things as well when it comes to unicode, so I'd avoid that until it's working as a standard function.

The difference between machines could be the code page set for non-unicode programs.

Path provided by {allfilepath} is correct (when using dopus script, not ms-dos) but it seems that if the current working dir contains polish chars, image magick gets it incorrect so it doesn't work anyway. But I found a solution that for now seems to work:

first, change current dir to something that doesn't contain polish chars, and then pass full paths for both, input files and output file:

cd \
/utils/ImageMagick/convert -border "20" -bordercolor "#FFF" -gravity center +append {allfilepath$} {sourcepath$}/output.png 

thank you for investigating this.

Edit: Also, dopus script mode has to be selected.