I have added notepad++.exe to my Path in Environment variables.
Now in command prompt, notepad++.exe filename.txt opens the filename
If you're just going for some simple commands, you could follow these steps:
Maybe overkill, but unlike the (otherwise excellent) answer from @Argyll, this solves the problem of this loading every time.
For instance, I have a file called dig2.bat with the following in it:
@echo off
echo.
dig +noall +answer %1
Your np file would just have the following:
@echo off
echo.
notepad++.exe %1
Then just add the C:\Aliases folder to your PATH environment variable. If you have CMD or PowerShell already opened you will need to restart it.
FWIW, I have about 20 aliases (separate .bat files) in my C:\Aliases directory - I just create new ones as necessary. Maybe not the neatest, but it works fine.
UPDATE: Per an excellent suggestion from user @Mav, it's even better to use %* rather than %1, so you can pass multiple files to the command, e.g.:
@echo off
echo.
notepad++.exe %*
That way, you could do this:
np c:\temp\abc.txt c:\temp\def.txt c:\temp\ghi.txt
and it will open all 3 files.