Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's my predicament:

When I add a program's location to my PATH, I can do the following in cmd prompt to open a file in my current directory:

notepad++ open_me.txt

And this opens open_me.txt in notepad++.

However, I don't want to have to add every single program I want to run to my path. What I want is to add a folder called C:\Users\Me\Documents\Programs to my path and just drop shortcuts to various programs into that folder and have them function the same as adding them to my path.

So I dropped a link to notepad++.exe named "np" in my folder, and what I got was this:

I have to run it with start np (instead of just np)

But more importantly, if I try start np open_me.txt, it opens notepad++.exe but looks for open_me.txt in notepad++'s directory.

How can I do this properly? (Also, I'd like to be opening notepad++.exe with the shortened name of np)

share|improve this question

migrated from Nov 13 '11 at 17:14

This question came from our site for professional and enthusiast programmers.

Sounds to me like you already know how to "do this properly" - you're just too lazy to do it.

A work-around for some commands (it'll work in your particular use case, but not much further) would be to drop batch files into a folder that is already in %PATH%. So, instead of using a shortcut for "np" you would put the following in "np.bat":

"C:\Program Files (x86)\Notepad++\notepad++.exe" %1

Then, whenever you run np Filename.txt it should run Notepad++ and open Filename.txt. Remember to use quotes for filenames that include spaces.

share|improve this answer

You must log in to answer this question.