Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Windows 8.1 .js file association does not allow passing arguments #9338

@SkyLined

Description

@SkyLined

Problem

It seems that the Node.js x64 0.12.0 installation on Windows 8.1 adds the following file association with ".js" files to the registry:

HKEY_CLASSES_ROOT\Applications\node.exe\shell\open\command\
"@"=REG_SZ:"C:\Program Files\nodejs\node.exe" "%1"

Unfortunately, this does not allow passing arguments to the script:

C:\>test.js a b c
Arguments: []

Proposed fix

This is easily fixed by modifying the association and add "%*" like so:

HKEY_CLASSES_ROOT\Applications\node.exe\shell\open\command\
"@"=REG_SZ:"C:\Program Files\nodejs\node.exe" "%1" %*

Now if I run the same test, it works as expected:

C:\>test.js a b c
Arguments: ["a","b","c"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions