I like using the command prompt to write and compile java. To write the code I enter this in cmd:
notepad MyJavaClass.java
This opens notepad and asks if I want to create new file (If it doesn't already exist). The problem for me is that I like using notepad++ as a text editor because it has nice features.
So my question is:
I tried to simply place the notepad++.exe file in the System32 folder, but cmd doesn't recognize the command.
Sorry for the noobiness :)
Notepad ++是一个已知的应用程序,因此如果您使用START
内置启动它,它将无需修改PATH
。
start notepad++ MyJava.java
Add notepad++ to your path
In Windows (Using GUI):
From the Start Menu, right-click Computer, select Advanced system settings in the left area, then select Environment Variables at the bottom in the window that pops up.
Go to the PATH user variable and click edit, and append YOUR path to notepad++ to the end. For example:
C:\\Program Files (x86)\\Notepad++;
Don't forget the semi-colon! Be sure the entry before it is also ended with a semi-colon.
In Windows (Using command line running as Administrator)
To set only for the duration of command line session:
set PATH=%PATH%;C:\\Program Files (x86)\\Notepad++;
To permanently set, use the same command as above but replace set
with setx
:
Note that not all Windows distributions come with setx, and can be manually installed here .
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Autorun
path %userprofile%\desktop;%path%&doskey /macrofile="%userprofile%\macros.txt"
Here I'm adding a path, then setting the doskey macros.
You could do this
doskey /macrofile="%userprofile%\macros.txt"
In the macros.txt do this
n="c:\somewhere\notepad++.exe" $*
Now you just type
n <filename>
See
set /?
doskey /?
cmd /?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.