Shortcut to open the Node Command Prompt in Any Folder

command linenode.jsshortcuts

For example, you can open a Windows Command Prompt in any folder with the shortcut:

  • Shift key + right-click

Is there any similar shortcut available to open the Node command prompt in any folder?

Best Answer

There is no built-in way to do this. But you can create one for the right-click of a folder (just like the "Open command prompt here" examples on the internet).

Create a file named Open Node-prompt here.reg and double click it (and click Yes and OK):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Node]
@="Open Node here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Node\command]
@="cmd.exe /s /k \"pushd \"%V\" & \"C:\\Program Files\\nodejs\\nodevars.bat\"\""

This will start the normal (cmd.exe) prompt in the correct chosen directory with first setting all the necessary variables for node.exe. After doing the dirs and cds you can call your node program.js just like normal.