Change your Windows path

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:


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:


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.



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)


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


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


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


The path is selected when this opens.


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 way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , . Bookmark the permalink.

2 Responses to Change your Windows path

  1. dvroman says:

    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 says:

    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.