coreybutler / coreybutler/node-windows

Can't get running as specific user to work

Open
#89 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.9k
Forks
368
PR merge metrics
No merged PRs in 30d

Description

The documentation says this:

By default, it will run using the user account that launched the process (i.e. who launched node app.js).

However, if I put this in app.js:

```
var username = process.env['USERPROFILE'].split( path.sep )[2];
```

And log it, I get 'system32' rather than my username.

If I put that same printout in the appservice.js file (which creates the Service object, etc), it prints the username I would expect, which is my username.

I've tried explicitly overriding the Service instance's user object with my credentials and domain name, but that doesn't help either. I get 'system32' in that case as well.

Anyone know if this is a bug, or if I'm doing something wrong?

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.