How do I make notepad ++ a function like a normal notepad in cmd?

I like to use the command line to write and compile java. To write the code, enter it in cmd:

notepad MyJavaClass.java

This opens notepad and asks if I want to create a new file (if it doesn't already exist). The problem for me is that I like to use notepad ++ as a text editor because it has nice features.

So my question is:

How do I make it so that I can type "notepad ++ MyJavaClass.java" into cmd and open notepad ++, ready to edit without typing the full path to notepad ++?

I tried to just put the notepad ++. Exe file in the System32 folder, but the cmd doesn't recognize the command.

Sorry for the ugliness :)

+4


source to share


3 answers


Add notepad ++ to your path

On Windows (using a GUI):

From the Start menu, right-click on Computer, select Advanced System Settings in the left pane, then select Environment Variables at the bottom of the pop-up window.

Go to your custom PATH, click Edit and add YOUR notepad ++ path to the end. For example:

C:\Program Files (x86)\Notepad++;

Don't forget the semicolon! Make sure that the entry before it also ends with a semicolon.



On Windows (using command line as administrator)

To install only for the duration of a command line session:

set PATH=%PATH%;C:\Program Files (x86)\Notepad++;

For permanent configuration use the same command as above, but replace set

with setx

:

Note that not all Windows distributions come with setx and can be installed manually here .

+13


source


Notepad ++ is a well-known application, so if you run it with the built-in START

, it will work unchanged PATH

.



start notepad++ MyJava.java

      

+15


source


HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Autorun 
path %userprofile%\desktop;%path%&doskey /macrofile="%userprofile%\macros.txt"

      

This is where I add the path and then install the doskey macros.

You can do it

doskey /macrofile="%userprofile%\macros.txt"

      

In macros.txt do this

n="c:\somewhere\notepad++.exe" $*

      

Now you just type

n <filename>

      

Cm.

set /?
doskey /?
cmd /?

      

0


source







All Articles