Custom commands in windows Command Prompt

Create a .bat file and save it as npt.bat

In that file put the following line of code (or change it to match the path to your notepad++.exe))

@START c:\"Program Files (x86)"\Notepad++\notepad++.exe "%1"

Note that you need quotation marks around any parts of the path with spaces in it.

Now place it in whatever directory you like and add the directory to PATH in your User variables.


You can use doskey. Try:

doskey ntp=notepadpp.exe

and now you can do simply:

ntp blah.txt


Create a batch file containing this line

@START c:\Program Files\Notepad++\notepad++.exe "%1"

and put it into some directory that is in your PATH list (or, alternatively, add a directory with a .bat file to PATH).


You can also create a bat file which does what you wish (mentioned in other answers here), then put it in C:\Windows\System32.

Execute it by writing the name of the file. For example ntp if your file was named ntp.bat

Make sure that you restart the command line before trying your new super cool custom command.