Hi,
For your first example, it’s likely that something about your path is causing it to fail. Unfortunately, without seeing the path, I can’t comment on what that is. For example, the following works fine for me:
studio.system.start("C:/Users/MyUsername/AppData/Local/Programs/Microsoft VS Code/Code.exe", {timeout: 1000})
For your second and third examples, workingDir
is the directory that the new process/executable will be opened in, not the path from which your pathToExecutable
argument operates from. In your second example, you haven’t provided a path to your executable (and timeout
should be in {}
). In your third example, if your relative path is from the FMOD Studio executable, and not workingdir
, it should be fine - my FMOD Studio install directory is:
"C:/Program Files/FMOD SoundSystem/FMOD Studio 2.0x.xx"
so the following command that uses a relative path works:
studio.system.start("../../../Users/MyUsername/AppData/Local/Programs/Microsoft VS Code/Code.exe", {timeout: 1000, workingDir: "C:/"})
If the above hasn’t cleared up your confusion, and/or your paths still don’t work, could I get you to provide your FMOD Studio version?
As for directly running cmd
, I have been able to reproduce an issue with it not opening a window, and hanging for a long time when attempting to do so, and I’ve noted this in our internal issue tracker. However, If you specify “/c” in your args
, cmd will still execute commands and then terminate. For example, you can indirectly open a cmd
window with studio.system.start("cmd", {args: "/c start cmd"})
, and the following should write “blahblahblah” to “textFile.txt” in your local user folder (i.e. “C:/Users/YourUsername”):
studio.system.start("cmd.exe", {args: "/c echo blahblahblah >> %UserProfile%/testFile.txt"})
Bit of an info dump, but I hope it helps.