Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can start the regular Notepad from cmd.

C:\Windows>notepad

I can also start it from the run prompt.

  1. Win+R
  2. notepad
  3. Enter

I want to be able to do the same with the Notepad++. I can start it from the run prompt, but I can't start it from cmd.

I can also open a specific file in Notepad from cmd.

C:\Windows>notepad d:\mytext.txt

I want to be able to do the same with Notepad++.

Is this possible, and what can I do to enable this?

share|improve this question
add comment

4 Answers

up vote 6 down vote accepted

You could add C:\Program Files (x86)\Notepad++ to your PATH environment variable.

For example, you could run the following on the command prompt:

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

For further options, see What are PATH and other environment variables, and how can I set or use them?

share|improve this answer
    
Thanks! It works now. Now I can do notepad++ %userprofile%\desktop\testfile.txt which is nice. I used the Environment Variables dialog box for this. What's the syntax for removing an environment variable using the set command? I couldn't find any specific switches or syntax for this. Not on the link you provided and not on the Computer Hope website. –  sammyg Jun 13 '13 at 21:24
1  
@Sammy: Removing a single directory from the PATH variable is best done through the GUI, I assume. I don't know how to quickly remove it from the command line. If you want to completely remove an environment variable, you can use set something=, but I wouldn't advise you to do that for PATH. –  Oliver Salzburg Jun 13 '13 at 21:26
    
I found a path command. I understand I'm supposed to use semi colon to delete a path in the PATH variable?... I'm not sure how. –  sammyg Jun 13 '13 at 21:32
    
Using path ; clears the search path settings for the current instance of cmd. It doesn't actually remove the search paths from the PATH variable. By opening a new cmd window the search path settings are restored. Oh well, I guess I will use the GUI then. –  sammyg Jun 13 '13 at 21:47
1  
This is worth noting: "Changes made with SET will remain only for the duration of the current CMD session." This can be found here. And it says that Set command is used to display, set, or remove CMD environment variables. So Set command can be used to remove the whole variable, in this example the PATH variable. And again, it will not be permanently removed from Windows. It is only valid for the duration of the CMD session. To permanently set an environment variable from CMD, the Setx command should be used instead. Either that or GUI. –  sammyg Jun 13 '13 at 22:09
show 2 more comments

I would not want to clutter my PATH just for using a single tool.

One alternative is to use Notepad++ as 100% replacement for Notepad as explained here.

A less invasive alternative is a cmd file like this:

"C:\Programme\Notepad++\notepad++.exe" %*

This file has to reside somewhere along the existing PATH. I actually put all my tools in one common UTIL directory, which is part of PATH.

share|improve this answer
    
What do you mean by "cmd file"? And what's with the asterisk and the percent sign? What file has to reside "along" the PATH? (It's not like it's going somewhere.) How do you make use of UTIL? Last time I checked there is no variable called UTIL. Is this something you came up yourself and added manually to the system? Can you explain any of this? And maybe give me some concrete example I can work with and hopefully learn from? Or are you just here to brag about how you know command line? I don't mean to be rude or anything, I'm just saying how it is. We all have different skill levels. –  sammyg Jun 14 '13 at 15:33
    
A cmd file could be the text script file npp.cmd which has the command as single text line inside. If you create a directory c:\util and put the script file into it, extend your PATH by c:\util, you from then on can call Notepad++ by typing "npp". %* stands for "all commandline arguments". –  Axel Kemper Jun 14 '13 at 17:41
    
A cmd file is often called a "batch file". In the days of MS-DOS, the extension was always .BAT but these days it is often .cmd. The commands in the file are executed by cmd.exe which is the command-line shell itself. –  steveha Oct 23 '13 at 7:04
add comment

Add the program directory to your PATH.

share|improve this answer
add comment

One way is to make a change to this registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Notepad++.exe]

You can download a zipped .reg file from Donn Felker that lets you open a file with just an n shortcut.

I edited the .reg before running it and to make sure the path to Notepad++ is correct (e.g. C:\Program Files (x86)) and I also changed the shortcut to n instead of n.

Then double click to add to your registry.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.