# \[W10\] Does anybody got problem with exec with NSSM?

**URL:** https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771
**Category:** General
**Created:** [28 March 2020 07:52 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771 "2020-03-28T07:52:32Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pagkly](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pagkly/32/17473_2.png) [@pagkly](https://discourse.nodered.org/u/pagkly)
#### Post date: [28 March 2020 07:52 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/1 "2020-03-28T07:52:32Z")

</div>

I have been trying to run exec command but it does not work if I start node-red with NSSM on W10.  
However, it works if I start node-red manually.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [28 March 2020 08:36 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/2 "2020-03-28T08:36:13Z")

</div>

What account is nssm using?

My guess is system account.

My second guess is your mom global directory is set for something like `c:\users\youname\blahblah`

My third guess is the path variable for node & this node-red with is set up in user environment variables - meaning when `system` tries to run node-red it has no idea where node or node-red are.

Look in those areas.

---

<div class="post-metadata">

### Author: ![pagkly](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pagkly/32/17473_2.png) [@pagkly](https://discourse.nodered.org/u/pagkly)
#### Post date: [28 March 2020 09:05 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/3 "2020-03-28T09:05:34Z")

</div>

I install nssm from chocolatey;

`choco install nssm`

My user is administrator.

I run both node-red manually from elevated and non-elevated powershell/cmd  
exec runs fine

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [28 March 2020 09:11 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/4 "2020-03-28T09:11:51Z")

</div>

so you didnt answer my questions about what account NSSM is using

- NSSM runs your application as windows service.
- When it executes your application (node-red) it uses a windows account - If you dont specify an account in NSSM settings, it will probably use the "system" account (not yours, not administrator etc)
- As your install of node-red is likely in `c:\users\youname\blahblah` and your `PATH` environment variable is set for USER (not for system) - the `system` account cannot find node-red.

Does any of the above make any sense?

EDIT...  
run node-red and copy the text you see in the cmd window between 3 backticks  
e.g...

`````  
`paste node-red startup text from cmd window here`  
`````

---

<div class="post-metadata">

### Author: ![pagkly](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pagkly/32/17473_2.png) [@pagkly](https://discourse.nodered.org/u/pagkly)
#### Post date: [28 March 2020 09:20 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/5 "2020-03-28T09:20:19Z")

</div>

28 Mar 20:08:59 - [info]

# Welcome to Node-RED

28 Mar 20:08:59 - [info] Node-RED version: v1.0.3  
28 Mar 20:08:59 - [info] Node.js version: v12.16.1  
28 Mar 20:08:59 - [info] Windows\_NT 10.0.18362 x64 LE  
28 Mar 20:08:59 - [info] Loading palette nodes  
28 Mar 20:09:01 - [info] Worldmap version 2.3.2  
28 Mar 20:09:01 - [info] Dashboard version 2.19.4 started at /ui  
(node:20468) [DEP0016] DeprecationWarning: 'GLOBAL' is deprecated, use 'global'  
28 Mar 20:09:01 - [info] Settings file : \Users\SP3.node-red\settings.js  
28 Mar 20:09:01 - [info] Context store : 'default' [module=memory]  
28 Mar 20:09:01 - [info] User directory : \Users\SP3.node-red  
28 Mar 20:09:01 - [warn] Projects disabled : editorTheme.projects.enabled=false  
28 Mar 20:09:01 - [info] Flows file : \Users\SP3.node-red\flows\_DESKTOP-V1QPP0J.json  
28 Mar 20:09:01 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
28 Mar 20:09:01 - [warn]

---

<div class="post-metadata">

### Author: ![pagkly](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pagkly/32/17473_2.png) [@pagkly](https://discourse.nodered.org/u/pagkly)
#### Post date: [28 March 2020 09:25 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/6 "2020-03-28T09:25:44Z")

</div>

Ah sorry, I see what you mean now.  
I just changed the local account to my account.

Will update if it works.

---

<div class="post-metadata">

### Author: ![pagkly](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pagkly/32/17473_2.png) [@pagkly](https://discourse.nodered.org/u/pagkly)
#### Post date: [28 March 2020 09:34 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/7 "2020-03-28T09:34:26Z")

</div>

After changing the account with

`nssm edit Node-red`

and go to log-on and input my credentials

still not working

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [28 March 2020 10:29 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/8 "2020-03-28T10:29:16Z")

</div>

What account did you enter in nssm ? Was it `SP3.node-red`?

Because that's what account you seem to be using

Also, you might need to look into permitting that account to "Log on as a service"

> [@pagkly](#):
>
> still not working

Have you looked in Windows event log - it will highlight these kind of issues

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [27 May 2020 10:29 UTC](https://discourse.nodered.org/t/w10-does-anybody-got-problem-with-exec-with-nssm/23771/9 "2020-05-27T10:29:22Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
