How to use "run()" to open a file?

I have a figure, say, saved at the path of “D:/1.svg” and want it to be opened via the “msedge.exe” browser in windows 11. The execution of “run(start D:/1.svg)” throws error like this

However, I can directly open the figure via the Powershell

Any idea to tackle it?

Did you look at: The "shell mode" in the REPL is not fully functional on Windows · Issue #23597 · JuliaLang/julia · GitHub ?

1 Like

To summarize: start is probably not an executable but a powershell builtin. If this is the case there are two options:

  1. Find out how powershell translates this into calling an executable and then do that directly from Julia.
  2. Call powershell from Julia and instruct it to run the start command.

(I’m not a Windows user so can’t help with any details how to do those things.)

1 Like

I just figured out one viable way like this:

run(`C:/“Program Files (x86)”/Microsoft/Edge/Application/msedge.exe D:/1.svg`)