0

How do I open a non-text file, say server.js, with a text editor (e.g. Notepad) with a command prompt?

I currently use a workaround where I create server.txt, edit it, then rename it to server.js, but it'd be nice to have a more straightforward method.

Thank you in advance!

1 Answer 1

2

To open a file which does not have .txt extension in notepad, try

c:\> notepad server.js

Note: You can start also start Visual Studio Code, using commandline with > code <filename>. If the file does not exist, a new file will be created in editor.

Sign up to request clarification or add additional context in comments.

3 Comments

Nice! Ty. Now is there a command that can both create and open the item? new-item abc.yaml | notepad abc.yaml works, but is there anything faster?
just - notepad <filename> will do, if the file does not exist, notepad will prompt to create a new file
this is awesome, tysm

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.