On Windows 7/8 and 10 you have a number of ways to do this.
- Open Control Panel > Control Panel Home > Default Programs > Set Associations
- Select a file type ( js )in the list and click Change Program then select NotePad
- right-click the file whose association you want to change > Properties > General tab > Type Of File > Change > Choose a program from the list or recommended or other programs select NotePad
What happens now?
When you get a file with this extension rather than just run it will open NotePad, for most users you will never beware that anything has changed, if your are a developer then you should know how to make this work for you.
What else can I do?
If this is your own personal machine for business you might want to repeat the process for the following file extensions:
- ps1 ps1xml, ps2, ps2xml, psc1, psc2
- vb, vbs
- ws, wsf
- wsc, wsh
- msh, msh1, msh2, mshxml, msh1xml, msh2xml