Windows 10 Registry Change: Adding a New JS File Context Menu
In this article, we will discuss how to add a new context menu to the Windows 10 registry for running JavaScript (JS) files using Node.js. This change allows users to run JS files directly from the context menu, making it easier and more convenient to execute these files.
Registry Structure
To add a new context menu to the Windows 10 registry for running JS files using Node.js, you need to make a change to the following registry key:
HKEY\_CLASSES\_ROOT\.js\shell\Run Node.js\commandThe structure of the registry key should be as follows:
"C:\Program Files
odejs
ode.exe" "%1"This registry key sets the default program for opening JS files to Node.js, allowing you to run JS files directly from the context menu.
Steps to Add a New Context Menu
To add a new context menu to the Windows 10 registry for running JS files using Node.js, follow these steps:
- Press Win + R to open the Run dialog box.
- Type
regeditand press Enter to open the Registry Editor. - Navigate to the following registry key:
HKEY\_CLASSES\_ROOT\.js- Right-click on the
.jskey and selectNew > Key. - Name the new key
shelland press Enter. - Right-click on the
shellkey and selectNew > Key. - Name the new key
Run Node.jsand press Enter. - Right-click on the
Run Node.jskey and selectNew > Key. - Name the new key
commandand press Enter. - Double-click on the
(Default)value in thecommandkey. - In the Edit String window, set the value data to:
"C:\Program Files
odejs
ode.exe" "%1"This sets the default program for opening JS files to Node.js, allowing you to run JS files directly from the context menu.
Testing the New Context Menu
To test the new context menu, right-click on any JS file and select Run Node.js from the context menu. This will open the JS file in Node.js and execute it.
In this article, we discussed how to add a new context menu to the Windows 10 registry for running JS files using Node.js. By making a change to the following registry key:
HKEY\_CLASSES\_ROOT\.js\shell\Run Node.js\commandYou can set the default program for opening JS files to Node.js, allowing you to run JS files directly from the context menu. This makes it easier and more convenient to execute JS files in Windows 10.
References
How to Add "Open With Notepad" to the Context Menu for All File Types in Windows 10
How to add 'Open command prompt here' and 'Open PowerShell here' to the context menu in Windows 10
These references provide additional information on how to customize the context menu in Windows 10.