How to change path windows

Set PATH and other environment variables in Windows 10

In older windows systems you had to navigate to Advanced System Settings in Control Panel to view, edit or add environmental variables.

  • Windows XP — Right-click My Computer, and then click Properties → Advanced → Environment variables → Choose New, Edit or Delete.
  • Windows 7 — Click on Start → Computer → Properties → Advanced System Settings → Environment variables → Choose New, Edit or Delete.

In Windows 8 and 10, you can navigate to Advanced System Settings in a similar way.

  • Windows 8 — Right click on bottom left corner to get Power User Task Menu → Select System → Advanced System Settings → Environment variables → Choose New, Edit or Delete.
  • Windows 10 — Right click on Start Menu to get Power User Task Menu → Select System → Advanced System Settings → Environment variables → Choose New, Edit or Delete.

However, in Windows 10 you can directly get to the Environment Variables window using Search the web and Windows box next to the Start menu. Type environment variables in Windows Search box which gives you two options in search results:

  • Edit the system environment variables
  • Edit environment variables for your account.

Choose either option and you can add, edit or delete environment variables like PATH.

Set environment variables from command prompt

You can set environment variables from Windows Command Prompt using the set or setx command. The set command only sets the environment variable for the current session. The setx command sets it permanently, but not for the current session. If you want to set it for current as well as future sessions, use both setx and set.

For example, you can set the PATH environment variable permanently (current and future sessions) as below:

To view the current path, run:

  1. By default setx sets the variable in the local environment (Under HKEY_Current_User Registry key). If you want to set the system variable (Under HKEY_LOCAL_MACHINE registry key), use the flag /m. Start the command prompt as administrator on Windows 10, right click on Start menu and select Command Prompt(Admin).
  2. The maximum value allowed for a enviroment variable is 1024 characters. So if your variable is long and you try to append to it with setx, you may get a truncated result.

Set environment variable by Registry edit

If your PATH variable is too long, then the best method would be to edit the registry.

For user environment variables, change the key HKEY_CURRENT_USER\Environment . For System Environment variables change

Add, Edit or Delete the environment variable you want to change, then reboot to activate the changes.

How to set the path and environment variables in Windows

Setting the path and environment variables will differ depending on the version of Windows you have on your computer. Choose a link below for your version of Windows.

Administrator privileges are usually required to modify the path and environment variables.

Setting the path and variables in Windows 10

  1. From the desktop, right-click the very bottom-left corner of the screen to get the Power User Task Menu.
  2. From the Power User Task Menu, click System.
  3. In the Settings window, scroll down to the Related settings section and click the System info link.
  4. In the System window, click the Advanced system settings link in the left navigation pane.
  5. In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
  6. In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon, as shown below.
Читайте также:  Установить мобильное приложение для windows phone

You can edit other environment variables by highlighting the variable in the System variables section and clicking Edit. If you need to create a new environment variable, click New and enter the variable name and variable value.

To view and set the path in the Windows command line, use the path command.

Setting the path and variables in Windows 8

  1. From the desktop, right-click the very bottom-left corner of the screen to get the Power User Task Menu.
  2. From the Power User Task Menu, click System.
  3. Click the Advanced System Settings link in the left column.
  4. In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
  5. In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon, as shown below.

You can edit other environment variables by highlighting the variable in the System variables section and clicking Edit. If you need to create a new environment variable, click New and enter the variable name and variable value.

To view and set the path in the Windows command line, use the path command.

Setting the path and variables in Windows Vista and Windows 7

  1. From the desktop, right-click the Computer icon and select Properties. If you don’t have a Computer icon on your desktop, click Start, right-click the Computer option in the Start menu, and select Properties.
  2. Click the Advanced System Settings link in the left column.
  3. In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
  4. In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon, as shown below.

You can edit other environment variables by highlighting the variable in the System variables section and clicking Edit. If you need to create a new environment variable, click New and enter the Variable name and Variable value.

To view and set the path in the Windows command line, use the path command.

Setting the path and variables in Windows 2000 and Windows XP

The path is now managed by Windows 2000 and Windows XP and not the autoexec.bat or autoexec.nt files, as was done with earlier versions of Windows. To change the system environment variables, follow the steps below.

  1. From the desktop, right-click My Computer and click Properties. If you don’t have a My Computer icon on your desktop, click Start, right-click the My Computer option in the Start menu, and select Properties.
  2. In the System Propertieswindow, click the Advancedtab.
  3. In the Advanced section, click the Environment Variablesbutton.
  4. In the Environment Variables window (as shown below), highlight the Path variable in the System Variable section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon, as shown below.

You can edit other environment variables by highlighting the variable in the System variables section and clicking Edit. If you need to create a new environment variable, click New and enter the Variable name and Variable value.

To view and set the path in the Windows command line, use the path command.

What is the default Windows %PATH%?

The path is based on programs installed on the computer, so there is no «default path.» However, the Windows minimum path is often the path below.

Keep in mind that as you install programs, the path is updated with the paths for the newly installed programs. So, if you have erased your path after installing other programs, those programs may be affected.

Читайте также:  Где находиться справочная система windows

Setting path in the MS-DOS and Windows command line

To view and set the path in MS-DOS and in the Windows command line, use the path command.

How do I change the system path permanently?

thanks in advance.

Make a Restore Point and be very careful

Hope this helps.
Rob — Bicycle — Mark Twain said it right.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

From the start menu open up «System»

Click on «Advanced system settings» from the Tasks list.

On the Advanced tab of the System Properties dialogue click «Environment Variables. «

From the Environment Variables dailogue you can change either the user (or profile) variables or the system variables (all profiles). Find the «path» variable and include the path value you wish and click ok. Any NEW processes (such as a command prompt) will utilize the new environmental variables that you set. Any existing processes will keep the existing variables until they are changed from the process or the process is terminated and re-opened to re-load the new variables.

This settings from the System Properties are persistent and will be maintained through new processes being spawned, sessions logged off/on, and reboots. They are used every time a process that utilizes environmental variables loads.

What you set from the command prompt using the DOS command SET variable=value will only be resident for the life of that process or session as you mentioned in your post.

1 person found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Modifying the “Path to executable” of a windows service

I’d like to modify the path to my application, but doing so breaks it because the service still points to the old location.

By going to Administrative Tools > Services you can open a properties dialog and view the Path to executable , but there is no way to change it.

Is there any way a user can modify the service path without having to reinstall the application ?

8 Answers 8

There is also this approach seen on SuperUser which uses the sc command line instead of modifying the registry:

Note: the space after binPath= is important. You can also query the current configuration using:

This displays output similar to:

It involves editing the registry, but service information can be found in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services . Find the service you want to redirect, locate the ImagePath subkey and change that value.

You could also do it with PowerShell:

Open Run(win+R) , type «Regedit.exe» , to open «Registry Editor», go to

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services

find «Apache2.4» open the folder find the «ImagePath» in the right side, open «ImagePath» under «value Data» put the following path:

«C:\xampp\apache\bin\httpd.exe» -k runservice foe XAMPP for others point to the location where Apache is installed and inside locate the bin folder «C:(Apache installed location)\bin\httpd.exe» -k runservice

Slight modification to this @CodeMaker ‘s answer, for anyone like me who is trying to modify a MongoDB service to use authentication.

When I looked at the «Path to executable» in «Services» the executed line already contained speech marks. So I had to make minor modification to his example.

  1. Type Services in Windows
  2. Find MongoDB (or the service you want to change) and open the service, making sure to stop it.
  3. Make a note of the Service Name (not the display name)
  4. Look up and copy the «Path to executable» and copy it.

For me the path was (note the speech marks)

How to edit system environment path variables on Windows 10

  • The Windows 10 path variable edit is a very useful feature if you use Command Prompt very often .
  • Using the advanced system settings is one way of how to change the path in Windows 10.
  • The process is as simple as editing the variables in the Environment Variables.
  • There you can also set the path in Windows 10 in the System variables box.
Читайте также:  Resident evil remake hd не запускается windows 10

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer’s security and performance
  • Restoro has been downloaded by 0 readers this month.

The Command Prompt is the last remnant of DOS (a former command-based operating system) preserved in Windows. You can open software and run handy tools, such as the System File Checker, with it.

For example, you can run SFC by entering sfc /scannow without specifying any path. To open third-party software in Windows 10, you would usually need to input a full directory in the Command Prompt.

The path environment variable tells your system where it can find the SFC, but not the software.

The path environment variable could be a handy setting for those who often make use of the Command Prompt.

Microsoft even replaced the Edit System Variable dialog in earlier Windows platforms with a new Edit environment variable path window in Windows 10.

How do I set the path variable in Windows 10? The easiest way is through View advanced system setting. There you can add, edit, or delete a path variable. After that, select the path that’s of interest to you and modify it in any way you want.

For a more detailed process, check the guide below.

How can I edit the path environment variable in Windows 10?

  1. In the Windows search box type advanced system settings and select View advanced system settings to open the window in the shot below.
  2. Press the Environment Variables button to open the window shown below.
  3. There you can select Path in the System variables box. Selecting Path and pressing the Edit button opens the window shown directly below.
  4. The Edit environment variable window above includes the following path: C:\Windows\system32 This is where the System File Checker tool is. To add your own path, press the New button.
  5. Enter C: in the empty space and press the Browse button to select a folder (If you don’t enter something in the space for the new path, your selected folder directory replaces the path listed above it).
  6. Select a folder that includes third-party software in the Browse for Folder window. For example, we selected a folder that includes Firefox.
  7. Press the OK button on the Browse for Folder window to confirm the selection (The Edit environment variable window will include your selected path as in the snapshot below).
  8. Press the OK button on Edit environment variable window to close it.
  9. Click the OK buttons on the Environment Variables and System Properties windows to close them.
  10. Type cmd in the Windows search box and click on Command Prompt on that menu to open it as below.
  11. Now you can open the software path you added to the Edit environment variable window by entering its executable. For example, if you added Firefox’s path to it you can open that browser by entering Firefox in the Command Prompt.

The Edit environment variable window enables you to add new paths to third-party software so that you can open the programs without entering their full directories in the Command Prompt.

Note: A program’s executable doesn’t always match the exact software title. For example, we found that Opera‘s executable was Launcher. As such, check the software’s executable title in File Explorer and then enter that in the Command Prompt.

No longer do you need to enter C:\folder\sub-folder\sub-folder software title to open a program. This certainly comes in handy if you’re not entirely sure what the software’s path is.

This is a fairly simple process and after following the steps above setting, editing, or changing the path environment variable in Windows 10 should be more or less a formality.

If you have any other questions about the process, feel free to leave them in the comments section below.

Оцените статью