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.

If I were to execute all executables in Windows in cmd, does that mean I need to add all folders containing executables to PATH? Coming from Linux, this seems like a huge hassle. Is there any way to automate or simplify the process?

share|improve this question
3  
An insane requirement often leads to an insane implementation. (And how is Linux any different? Any directory that has executables that you want to run just by name has to be on your path there too, right?) –  David Schwartz Apr 12 '12 at 10:36
    
Yes, but a lot of core executables are grouped together bin or sbin folders. I have 5 folders in my linux $PATH and that includes every program I know in linux. Windows, however, had 10 folders in its PATH and it still could not run a web browser. –  Forethinker Apr 12 '12 at 18:27

5 Answers 5

If you don't want to start en executable using it's full path you have to add the directory to the PATH environment variable.

The PATh variable can be edited for all users of a computer, for your current user account or only for a specific CMD instance. The latter can be used in a batch file that opens a CMD window and then extends the PATh variable for that CMD instance.

For doing so create a link (LNK) that executes the following command:

%comspec% /k ""C:\myvars.bat"" x86

Then create the batch file C:\myvars.bat that extends the PATH with the directories you need. Now if you open the link you get a CMD instance with your extended PATH.

share|improve this answer

The shell (via the registry) knows the location of many executables. So for example, where iexplore.exe might not work, start iexplore.exe does. You can also use arguments eg. start iexplore http://example.com.

share|improve this answer
    
I also found out that you can invoke shortcuts, lnk with start. –  Forethinker Apr 14 '12 at 4:39

Do you want to start your programs without using shortcuts or going through the start menu? If so, I would recommend slickrun. http://www.bayden.com/slickrun/

I can't use a computer without it. :)

share|improve this answer

Choose a directory that's already on the path or add a new directory for the purpose and add it to the path.

In it put BAT files that launch the programs you need, including the full path if necessary.

As often as not, you can get the full command line by rightclicking a shortcut to the file, Properties, look at Target:, copy/paste into your bat file.

share|improve this answer
up vote 0 down vote accepted

So far it seems to me that the best answer for my question is: Use cygwin with alias. It would be really like shortcuts in Windows were actual symbolic links.

The best solution I was looking for came with cygstart in cygwin. I don't even have to specify the program. It looks at the extension and runs the default program for that file.

share|improve this answer

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.