tags:

views:

50

answers:

2

Hi,

Let's say I have a foo.exe file that I want to use it from windows command prompt. I will go to the folder which contains foo.exe and run it. Now, if I want global access for foo.exe from anywhere in the command prompt I will put foo.exe in System32 folder.

This process makes System32 a dump ground. I was wondering if there are any other ways of globally accessing the .exe or bat files without having to dump all of them in System32 folder.

+3  A: 

Change your PATH environment variable. i.e. "set path=%path%;[newdir]"

where [newdir] is the new directory you want searched when you run commands.

The PATH Environment Variable

William Leara
You can also change the path on a windows machine by going to SystemProperties->Advanced->EnviromentVariables. At the top you have the user specific enviroment variables and at the bottom, the system wide ones. PATH can be in both.
Simon P Stevens
Note that the path size is limited (length depends on OS). If you have a few installed software that have added their folders to the path, it might overflow. The way to avoid that is to create a separate system variable, say FOOS_DIR, and assign foo's dir to it. Then, add %FOOS_DIR% to the system path instead of the actual path.
eran
A: 

You can either do this programatically (StackOverFlow) or follow these instructions How to set the path in Windows 2000 / Windows XP, another one.

merkuro