Buffer in running external program in loops

I mean, nothing happens and it lands in a deadlock. When I abort, the external program corresponding to ic=1 is launched in a new window.

EDIT: I reached the limit of number of posts for a new user (I know I should have created an account way earlier). Any way to avoid waiting 22 hours?

I’ll keep on editing here. In the REPL, it fails to run without any message, stg I often get when Julia meets an unexpected error it cannot handle. EDIT in EDIT: sorry, that’s when I use the shortcut “execute code and move” in VSCode, if I use include(“mycode.jl”) it leads to a deadlock as in the shell, but I can’t abort without stopping the REPL so I don’t know if the external program would ever be run.

EDIT 2: script.bat is in the current folder, I’m using

joinpath(@__DIR__,"script.bat") 

to get its absolute path.

EDIT 3: I’m working on a MWE and will keep you updated!

without anything else is not possible, I need arguments in practice…

EDIT 4: Problem solved, but not fully understood.

First, I feel sorry to have forgotten an important detail: I was not using

run(command)

but

try @spawnat :any run(command) catch; run(command) end

using non-necessary multi-threading (remnant of an earlier version to provide parallel execution for julia -and not system- code).

The problem disappeared by removing the multi-threading stuff, but why??? I could not reproduce this on my MWE (that is similar to yours). There, both the single- and multi-threaded versions work. So I dug a bit further and yes, your intuition was right, in the end the simple

run(`cmd /c "start $myexe $myinput"`)

just works fine. Basically I had the /c on the wrong side of the start in the run statement, and had to compensate by using an extra script implementing yet another start. Still what multi-threading has to do with this is a mystery we don’t need to solve. Thanks for your time and wisdom!!!