-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to execute child process #270
Comments
Have you reviewed the wiki? When it isn't permission problems, it's usually a path problem. |
Yes i have reviewed your wiki and this is not a path problem because i can see my task running in background process in task manager while running it with service |
This issue has been reported multiple times... Please suggest something so that we can make it working |
This is pretty specific to your environment, and there's not much I can do to diagnose if there's no way to recreate the problem. Perhaps you could put a gist up with your code. "this is not a path problem because i can see my task running in background process in task manager while running it with service" - this doesn't mean the process can find your executable. It just means the daemon is running. The only thing I can think of is to try using the absolute path to the executable, i.e. const command = 'C:\\\\path\\to\\jre-8u261-windows-x64.exe' The double backslash will escape the path so the script is recognized as What other issues are you referring to when you say this has been reported multiple times? This appears to be the first issue you've opened. |
This issue is still present, my script opens a detached process, which behaves correct, paths are absolute, no errors in the Service logs/output nor cli. I'm using in the detached process node-notifier. When starting the script from CLI the notifications are popping up, but not when the script is run by the Service. node-notifier uses some other exe for creating windows toasts. The Toast process appears in task manager, but its not triggered as it should. Workaround: I've opened Services > TheGeneratedService > Log On(tab) > checked This Account and used my account which is an administrator. Then I've restarted the service as prompted, and it worked as intended. I have tried to recreate the service with svc.logOnAs.(domain|username|password) and it created the service but it was identical as without the credentials, wasn't it supposed to behave like in the "workaround" above ? I've found a similar situation on SO which reflects this elevation issue at service level: Maybe someone can tackle this problem. Windows 10: 19042.804 20H2 |
I have a created a windows service using node-windows and it seems to work properly. But as soon as I have my child process call it does not execute my child process and if i switch to running it from cmd instead as a service it opens my executable.
This is nothing related to type of user as i only have one user as administrator
Below is my code
Tried using spawn
const command = 'jre-8u261-windows-x64.exe'
const bat = spawn(command, [],{
shell: true, // use to run in a shell if you need
detached: true, // important
stdio: "ignore",
});
Using exec:
const test = exec('jre-8u261-windows-x64.exe' );
Please suggest
The text was updated successfully, but these errors were encountered: