Skip to content

Change your Windows path

March 22, 2012

When you run something from the start menu or in a Windows command prompt, you type the program name to run the executable file. There are three ways in which you can execute something:

  1. the executable is in your current directory/folder
  2. you type the entire path to the executable.
  3. the PATH environment variable contains a value that points to the folder containing the executable.

The first and second items are fairly self explanatory. In a command prompt, if I change to the \Windows folder in Windows 7, I see these executables:

path1

If I type notepad (the .exe isn’t required), Windows searches the folder, finds notepad.exe, and runs it.

If I am in c:\Users\Steve, however, I can run notepad in one of two ways. I can do this:

path2

The other way is that I just type notepad, and it runs. How does this happen? It’s a holdover from DOS (and Unix) for an environment variable called PATH. My current path is returned by typing PATH in a command prompt.

path3

 

There are a lot of folders listed here, all separated by a semi colon.  Most of these are for various programs, and lots of installers alter the path to add their own folder. For example, the Live suite of products added this path

C:\Program Files (x86)\Windows Live\Shared

I would have thought most technical people knew how to change the path, but I found a developer recently that did not. I suspect most people don’t need to deal with this in most cases, so they aren’t aware.

The way you should change this manually in Windows is this. Go to the properties of your system by right clicking the “Computer” item in the Start Menu and select Properties. You’ll get this screen (in Windows 7)

path4 

Select the “Advanced System Settings” in the left side. This is an admin function, so you need the UAC permission. This will open a new dialog

path5

The Environment variables are accessed through a button on the Advanced tab. Once you press that, it will give you the variables dialog.

path6

If you scroll down in the System Variables, you’ll see PATH as an item. Select “Edit” and you can change the path.

path7

The path is selected when this opens.

DO NOT START TYPING.

Instead hit the right arrow to de-select all the txt and move to the end (as shown in the image above). Add a semi-colon and your path, and OK back out of all dialogs. You’ll have a new path that you can use in your system.

About these ads

From → Blog

2 Comments
  1. Because I use the command prompt frequently, I have several DOS utilities that reside in a folder on my C drive. Also, our security permissions are tightened down so I don’t have access to the user path statement. So what I did is create a MS-DOS batch file and a shortcut to that batch file on my desktop. When I need a command prompt, I click on that shortcut.

  2. Richard permalink

    Changing the PATH variable under system variables will change the path for all users. If you want to add a path that’s specific to your account, you can add a new PATH variable in the user variables section. The environment variable will combine the values from both.

Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 4,805 other followers

%d bloggers like this: