Modify path in windows

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.

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.
Читайте также:  Полная настройка windows 10 домашняя

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.

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.

Как отредактировать PATH в Windows 7, 8 и Windows 10?

Как запустить программу из командной строки не переходя каждый раз в папку с программой?! Как запускать сторонние программы так, как, например, программу IPCONFIG, которая не требует перехода в папку?

Что такое PATH система Windows?

Если вы скачали программу командной строки, например ADB (Android Debuggin Bridge), то вы не сможете запустить ее просто вписав adb в командной строке, как вы всегда поступали с системными командами Windows (IPCONFIG, NETSTAT и т.п.). Вместо этого вы должны будете указать командную строку содержащую полный путь к exe-файлу.

Это достаточно сложно писать в командной строке без ошибок, тем более, если вам приходится делать это достаточно часто.

PATH система Windows сообщает вашей операционной системе каталоги, в которых следует искать исполняемые файлы. Например ранее упоминаемая программа ipconfig.exe расположена в каталоге C:\Windows\System32, который в свою очередь уже добавлен в PATH Windows. При вводе команды ipconfig система обыщет все папки из PATH на наличие файла ipconfig.exe и запустит его выполнение.

Если вы хотите то же удобство с программой (в нашем примере это ADB), то приложение ADB необходимо добавить в PATH Windows и после этого для запуска достаточно будет вписать в командную строку:

Больше ничего впечатывать не придется.

Как добавить папку в PATH?

В Windows 7, 8 и Windows 10 попасть в настройки PATH можно так: Панель управления / Система / Дополнительные переменные среды.

Далее перейти в «Переменные среды».

В окне «Переменные среды» обратите внимание на переменную с именем Path. Выберите ее и нажмите «Изменить..»

Дальнейшие действия одинаковы в Windows 7 и 8, но иные, облегченные, в Windows 10.

Path в операционной системе Windows 7 и Windows 8

В этих системах переменная Path является не более, чем длинной строкой текста с адресами каталогов системы. В этот текст мы добавим каталог и с нашей программой ADB.

Читайте также:  Mapsource garmin mac os

Для того, чтобы добавить запись с путем к исполняемому файлу в Windows 7 и 8 к тексту нужно добавить путь, которому предшествует точка с запятой, разделяющая различные записи. Например так:

Добавлять такой путь в текст path нужно только в конец строки.

После ввода нажмите ОК. Все, мы добавили каталог в patch Windows 7 и 8.

Path в операционной системе Windows 10

В операционной системе Windows 10 этот процесс проще и менее запутанный. После нажатия кнопки «Изменить…» откроется новое диалоговое окно с расположенными в отдельных строках путях path.

Это улучшение позволяет проще и нагляднее видеть имеющиеся пути path и облегчает добавить новые пути.

Для добавления нового пути в переменную path Windows 10 нужно нажать «Новый», добавить путь C:\Android\platform-tools и нажать ОК.

Новая запись появится в низу списка.

Теперь запуск Android Debug Bridge доступен из любого раздела командной строкой без ввода полного пути к исполняемому файлу.

Add to the PATH on Windows 10

📅 March 17, 2018 ⏱ 1 min read

Hello fellow internet citizens! Here is a concise guide to modifying the PATH on Windows 10!

  • Open the Start Search, type in “env”, and choose “Edit the system environment variables”:
  • Click the “Environment Variables…” button.
  • Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit.
  • The “Edit environment variable” UI will appear. Here, you can click “New” and type in the new path you want to add. From this screen you can also edit or reorder them.
  • Dismiss all of the dialogs by choosing “OK”. Your changes are saved!
  • You will probably need to restart apps for them to pick up the change. Restarting the machine would ensure all apps are run with the PATH change.

To test it, in new PowerShell window, type:

Written by Ryan Hoffman, an experienced team leader, certified Scrum Master and software architect.
Contact RyanFollow Ryan on Twitter

Adding and Editing PATH Environment Variables in Windows

Sometimes we need to tell Windows where to look for a particular executable file or script. Windows provides a means to do this through the Path Environment Variable. The Path Environment Variable essentially provides the OS with a list of directories to look in for a particular .exe or file when the simple name of the file is entered at the command prompt.

For example, the Notepad.exe application resides in the C:\Windows\system32 directory. However, if we wish to open the Notepad application via the Windows Command Line, we need only type:

Opening Notepad.exe From the Windows Command Line:

This works because the Path variable on Windows by default contains a list of directories where application files and scripts are likely to be located. Each directory in the list is separated by a semi-colon.

Similarly, there is another environment variable, PATHEXT which specifies a list of file extensions which might be found when searching for the proper file within the paths in the Path variable. This is why we are able to type simply “Notepad” at the command prompt, instead of Notepad.exe.

Windows will first search the current directory (where the command prompt is a the time the command is executed) to find a name matching the one typed into the terminal, and then search the directories in the Path variable in order, beginning with the most likely locations, and continue until either a matching file name is located, or else return the “… is not recognized blah blah” message at the terminal.

Once a file with a matching name is located, Windows attempts to match the file extension (if one is present), again in the order specified in the PATHEXT variable. If a match is found, the file is processed accordingly.

There are both User-specific and machine-level PATH variables. Machine Path variables are available globally across the machine, and can only be modified by administrators. User Environment variables can be modified by both administrators, and the user with which the current profile is associated.

Adding a Directory to the User Path Variable from the Command Line

Any user can modify their own PATH variable from the Command Line (unless they have been specifically denied this ability by an administrator).

For example, when we wish to use SQLite from the Windows Command Line, we download the SQLite binaries, and place them in the directory of choice. However, in order to use the SQLite Command Line application without either navigating directly to the folder in which we placed it, or entering the full file path into our Windows Command Line, we need to add the directory containing the SQLite.exe to our User or System PATH environment variable.

Let’s say a user has downloaded the sqlite3.dll and sqlite3.exe binaries and located them in the directory C:\SQLite.

Now, in order to invoke the sqlite3.exe from the command line, we need to add the C:\SQLite directory to our PATH environment variable. We can do this from the command line by using the setx command:

The setx Command – Syntax:

When we modify environment variables using setx , the changes are not available in the current Console session – in other words, in order to see our changes, we need to exit, and open a new Console window. Then, we can use the following technique:

We can examine the contents of the PATH variable by typing:

Output PATH Variable to the Console:

Which gives the output:

Results of Echo %PATH% Command:

We can see here that C:\SQLite has now been added to the paths available to the current user.

Adding a Directory to the System Path Variable from the Command Line

In the previous section, we used the setx command to add a directory to the current user’s Path variable. Sometimes, we want to make variables available at the system, or machine level. In that case, we use the same setx command in conjunction with the /m flag. However, we need to run the Command Terminal as Administrator for this to work:

Add a Directory the the System PATH Variable Using the /m Flag:

Adding a Directory to the Path Variable from the GUI

Or, we can do this using the GUI by navigating to Control Panel => All Control Panel Items => System, and then selecting the “Advanced System Settings” link:

Locate Advanced System Settings in Control Panels:

Then locate the “Environment Variables” button:

Open Environment Variables:

Opening Environment Variables, we see the following:

Editing Environment Variables:

Notice in the image above, there are two sections, User Variables for , and System Variables.

Also note, there is not currently a Path variable for me, the current user. We will need to add one, and then add our new path to it:

Adding a User Path Variable in the Windows GUI:

Once we hit OK, We see we have the single item added to our user path variable.

Added Path Variable to User Environment Variables:

For some reason, this works differently than when we do this from the Command Line, when we use the setx command from the terminal, the entirety of the system path variable is copied into the user path variable, including the new entry.

If we have Administrator permissions on our machine, we can do the same for the System PATH variable if we so choose.

Removing Directories from the PATH Variable

In some cases, we may need to remove a directory from our PATH variable. In these cases it is recommended to use the GUI, or edit the registry. It’s easiest to simply open the GUI, copy the contents of the PATH variable (either the User Path or the System Path) to a text editor, and remove the entries you want to delete. Then paste the remaining text back into the Edit Path window, and save.

Читайте также:  Драйвера mtp для windows 10 64 bit
Оцените статью