Skip to content

Should use USERPROFILE instead of HOMEPATH on Windows #6106

@jeffrson

Description

@jeffrson

... or consider it as another fallback in paths.js.

I created a task in task scheduler that runs on system start and it happens to create pm2 files in c:/etc. For this, the user that runs the task must have elevated rights, which is neither necessary in all cases nor reasonable from a security point of view.

See here for some discussion about the topic regarding HOMEPATH vs USERPROFILE:
https://stackoverflow.com/questions/606483/what-is-the-meaning-of-these-windows-environment-variables-homedrive-homepath

Also, my application is successfully using os.homedir() which is another useful alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions