E
E
Edward Treit2021-08-13 19:58:42
Node.js
Edward Treit, 2021-08-13 19:58:42

Why does the application close after being launched via execFile?

I am writing an application using Electron, I need to launch another program from the application, which, in turn, launches another one, closing itself. It's Mod Organizer, if that's anything to say. It runs games like Skyrim and Oblivion. So here is the game launch shortcut inside contains the command

"D:\Oblivion\Mod Organizer\ModOrganizer.exe" "D:\Oblivion\obse_loader.exe"

I am trying to make this command run via execFile:
execFile('D:\\Oblivion\\Mod Organizer\\ModOrganizer.exe', ['D:\\Oblivion\\obse_loader.exe'], { cwd: 'D:\\Oblivion')

MO starts, but the game does not. The process exits with code 0. No errors, nothing. If you make an error in the argument path, then an MO error pops up, which means that there are no errors in the paths.
If run via exec:
exec('"D:\\Oblivion\\Mod Organizer\\ModOrganizer.exe" D:\\Oblivion\\obse_loader.exe', { cwd: 'D:\\Oblivion')

Everything works, the game starts.
The question is, what is the reason for this behavior? Why doesn't it work through execFile?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question