Add to the path on windows 10

On StackOverflow and on the net in general, there are outdated and few guides on how to add a specific folder to the Windows 10 Path environment variable of the user. I think a complete guide for ...

On StackOverflow and on the net in general, there are outdated and few guides on how to add a specific folder to the Windows 10 Path environment variable of the user.

I think a complete guide for new developers with step by step instructions and screenshots could be really usefull to help them executing utilities from a Command Prompt without the need of the full path, simplifying the things.

wdmssk's user avatar

wdmssk

331 gold badge2 silver badges4 bronze badges

asked May 30, 2017 at 21:40

MatPag's user avatar

For the guide below we want to add an example utility called mytool.exe which is located in C:UsersNewFolderInPathmytool.exe, so that everytime i want to execute the mytool utility i don’t have to specify the full path.

I used this as an example, you can replace the folder with something more realistic like the JDK bin directory located here C:Program FilesJava{JDK_VERSION}bin to execute javac, keytool or everything you want.

Step 1 — Click on the Windows icon

enter image description here

Step 2 — Click on the Settings icon

enter image description here

Step 3 — Click on System

enter image description here

Step 4 — Click on About

enter image description here

Step 5 — Click on System info

enter image description here

Step 6 — Click on Advanced system settings

enter image description here

Step 7 — Click on Environment variables...

enter image description here

Step 8 — Select Path row and then click Edit

enter image description here

Step 9 — Click New and then click Browse, then in the next panel which will open you need to select the folder you want in the Path. For the initial premise of this guide i will add the folder C:UsersNewFolderInPath

enter image description here

Step 10 — Click OK and click every OK button you will encounter to close every previous windows.

enter image description here

Step 11 — Open a command prompt (cmd) and now you can execute your utility without specifying the full path.

enter image description here

user's user avatar

user

4,3135 gold badges17 silver badges34 bronze badges

answered May 30, 2017 at 21:40

MatPag's user avatar

MatPagMatPag

39.9k14 gold badges102 silver badges110 bronze badges

3

To print each entry of Windows PATH variable on a new line, execute:

C:> echo %PATH:;=&echo.%

Set Windows PATH variable for the current session:

C:> set PATH=%PATH%;C:pathtodirectory

Set Windows PATH Permanently

Run as Administrator: The setx command is only available starting from Windows 7 and requires elevated command prompt.

Permanently add a directory to the user PATH variable:

C:> setx path "%PATH%;C:pathtodirectory"

Permanently add a directory to the system PATH variable (for all users):

C:> setx /M path "%PATH%;C:pathtodirectory"

answered Sep 29, 2021 at 22:02

HackSlash's user avatar

HackSlashHackSlash

4,5902 gold badges19 silver badges41 bronze badges


Download Article

A simple guide to adding a directory to the Windows 10/11 path variable


Download Article

  • Windows 7–11
  • |

  • Windows XP
  • |

  • Warnings

The PATH environment variable specifies in which directories the Windows command line looks for executable binaries. The process for changing it is not obvious, but it’s not too hard. Read on to learn how to change PATH.

Things You Should Know

  • Adding a directory to your path makes it possible to run programs from the command line without typing the full path.
  • To access your path settings, open Settings, type «path,» then click «Edit the System Environment Details.»
  • While adding directories to the path is simple, don’t remove any existing path directories.
  1. Image titled Change the Path Environment Variable Method2 step1.png

    1

    Open the «settings» application. This can be done by pressing the Windows key and clicking the gear icon in the «Start» menu. You can also search «settings» in Cortana or in the «Start» menu.

  2. Image titled Change the Path Environment Variable Method2 step2.png

    2

    Search «path» in the settings menu.

    Advertisement

  3. Image titled Change the Path Environment Variable Method2 step3.png

    3

    Select Edit the System Environment Details. This option should be below Show Full Path in Title Bar and above Edit the Environment Details for your Account. A menu titled «System Properties» should pop up.

  4. Image titled Change the Path Environment Variable Method2 Step4.png

    4

    Click Environment Variables. This should be on the right-hand side of the menu below the Startup and Recovery section.

  5. Image titled Change the Path Environment Variable Method2 Step5.png

    5

    Select Path. You should not have to scroll down to find this option. It is in between two options titled OS and PATHEXT.

  6. Image titled Change the Path Environment Variable Method2 Step6.png

    6

    Click Edit, and proceed to edit the PATH environment variable.

    Warning! Unless you want to potentially destroy your PC’s system, DO NOT edit this variable unless you know what you’re doing.

  7. 7

    Select OK once you’re done editing. This will save any changes you may have made.

  8. Advertisement

  1. Image titled Windows my computer desktop screenshot.png

    1

    Create a shortcut to «My Computer». Click on «Start», mouse over «My Computer», right-click on it, and select «Show on Desktop».

  2. Image titled Windows my computer properties.png

    2

    Right-click on the shortcut and select Properties. A window will open.

  3. Image titled Windows properties environment variables.png

    3

    Switch to the Advanced tab. In that tab, click on Environment Variables. Another window will open.

  4. Image titled Windows edit path environment variable v2.png

    4

    Scroll down until you see «Path». Select it and click on Edit. A third window will open.

  5. Image titled Windows append to path environment variable.png

    5

    Edit the PATH environment variable. Unless you really know what you’re doing, don’t remove what’s already there, only append to it. For example, you could add another directory by appending: ;C:pathtodirectory, with «pathtodirectory» being the actual path to the directory.

  6. Image titled Windows environment variable editing press ok.png

    6

    Click on OK. When the window closes, there should be a short delay because the environment variable is being updated. After that, you can press OK to close the other two windows, too.

  7. Image titled Windows cmd echo path envvar.png

    7

    Check that the environment variable changed. Open the command line by pressing Win+R, entering cmd, and pressing Enter. Type: echo %PATH%. The output should be your updated PATH environment variable.

  8. Advertisement

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Thanks for submitting a tip for review!

  • Changing the PATH environment variable wrongly can cause your system to stop working correctly. You should have a basic understanding of what you’re doing before changing PATH.

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 34,889 times.

Is this article up to date?

Привет, посетитель сайта ZametkiNaPolyah.ru! Продолжим разбираться с командами и системными утилитами в операционной системе Windows 10, на этот раз будет разговор о переменной PATH в Windows. Всё дело в том, что системная переменная PATH дает нам возможность расширить список команд командной строки Windows, как это сделать, вы узнаете из этой публикации. Здесь мы с вами поговорим о назначении системной переменной PATH, а также разберемся с вопросом: как добавить  путь к исполняемому файлу в системную переменную PATH в операционных системах Windows 10, Windows 8 и Windows 7. Этой публикацией можно пользоваться как простой инструкцией по добавлению значений в переменную PATH для Windows.

Если вам интересна тема компьютерных сетей, то в блоге уже практически закончена первая часть курса по основам компьютерных сетей, можете ознакомиться с ее содержимым. И вот здесь можно получить немного информации о самом курсе.

Что такое переменная Path и зачем она нужна в Windows. Зачем нужно добавлять путь?

Содержание статьи:

  • Что такое переменная Path и зачем она нужна в Windows. Зачем нужно добавлять путь?
  • Как добавить путь к программе в системную переменную Path в Windows 10 и Windows 8
  • Как настроить переменную Path в Windows 7
  • Выводы

PATH – это системная переменная окружения Unix-подобных (например, Linux Mint) операционных систем, а также операционных систем семейства Windows. В переменной PATH нет ничего сложно и хитрого, это обыкновенный список папок и каталогов, в которых лежат исполняемые файлы (программы). Программы, путь к исполняемым файлом которых задан в системной переменной PATH, могут быть исполнены (запущены) непосредственно из командной строки Windows и из любого места вашей файловой системы (в Linux тоже есть командная строка, но ее лучше называть эмулятор терминала).

Давайте лучше посмотрим на примере зачем нужна переменная PATH в операционных системах семейства Windows (как, впрочем, и в других семействах). Смотреть будем на примере сторонней утилиты командной строки Windows tracetcp.exe. Она у меня установлена по следующему пути: c:Program Filestracetcp. Запустим командую строку Windows и попробуем выполнить команду tracetcp.

Пробуем запустить стороннюю утилиту командной строки Windows

Пробуем запустить стороннюю утилиту командной строки Windows

Обратите внимание на то, что командная строка не смогла выполнить команду tracetcp, хотя приложение и установлено на мой компьютер, проблема заключается в том, что командная строка не смогла найти исполняемый файл tracetcp.exe. Но где командная строка его искала? Она искала этот файл в текущем каталоге, то есть в данном случае в каталоге: c:UsersDell, там этого файла не оказалось, затем командная строка обратилась к переменной PATH, там она не обнаружила пути к исполняемому файлу tracetcp.exe, но обнаружила путь к папке System32, проверила, что в этой папке также нет файла tracetcp.exe и выдала нам предупреждение: «»tracetcp» не является внутренней или внешней командой, исполняемой программой или пакетным файлом.».

Поскольку мы находились в папке, отличной от той, где находится файл tracetcp.exe, а пути в переменной PATH к этому файлу не оказалось, командная строка просто не смогла его найти, чтобы исполнить, давайте всё-таки его запустим, для этого нужно будет перейти в папку c:Program Filestracetcp при помощи команды cd (в операционных системах Linux тоже есть команда cd и работает она аналогично), а затем запустить утилиту.

Запуск исполняемого файла в командной строке Windows

Запуск исполняемого файла в командной строке Windows

Теперь командная строка Windows смогла запустить нашу утилиту, поскольку смогла найти исполняемый файл tracetcp.exe, но каждый раз переходить в папку, где лежит исполняемый файл или каждый раз указывать абсолютный путь к исполняемому файлу — это очень неудобно, будет гораздо лучше, если мы укажем путь к исполняемому файлу в переменной PATH, тогда командная строка будет самостоятельно его находить в любое время и в любом месте.

Исполняемый файл был запущен, поскольку путь до него был добавлен в системную переменную Path

Исполняемый файл был запущен, поскольку путь до него был добавлен в системную переменную Path

На рисунке выше показано, что командная строка смогла запустить приложение из домашней папки пользователя, но это лишь благодаря тому, что я добавил путь исполняемому файлу в переменную PATH, теперь команда tracetcp будет работать из любой другой папки. Утилита tracetcp довольно простое приложение, представляющее собой один исполняемый файл — tracetcp.exe, можно было бы не прописывать путь в переменную PATH, а просто скопировать этот файл в папку System32, но устанавливать сторонние и непроверенные приложения, не требующие наличия файлов в System32, не самая хорошая и безопасная затея. В Windows лучше потратить немного времени на то, чтобы добавить путь к файлу в переменную PATH, о том как это сделать мы и поговорим ниже, рассмотрев этот процесс для операционных систем Windows 10, Windows 8 и Windows 7.

Как добавить путь к программе в системную переменную Path в Windows 10 и Windows 8

Добавление пути к программе в системную переменную PATH в операционных системах Windows 10 и Windows 8 делается по одному алгоритму, показывать я буду на примере Windows 10, так как восьмерки под рукой нет. Ранее мы уже видели, что небольшая утилита tracetcp запускалась из командной строки Windows только в том случае, если мы переходили в ту папку, в которую она установлена. Но это легко исправить, просто добавив полный путь к исполняемому файлу tracetcp.exe в системную переменную PATH. Давайте это и сделаем. Описывать процесс добавления значения в переменную PATH буду буквально по шагам и с демонстрацией скриншотов окон в Windows 10. Хотя сперва я напишу сам алгоритм, если его не хватит, то обратитесь к скриншотам ниже:

  1. Открываем поиск и пишем: «Система» или «Панель управления».
  2. Появится окно, в левом верхнем углу которого есть небольшое меню и пункт «Дополнительные параметры системы».
  3. Появится окно поменьше, в нижнем правом углу есть кнопка «Переменные среды…».
  4. Откроется окно управления переменными средами в Windows 10.
  5. Нас интересует переменная PATH, которая находится в разделе «Системные переменные», нажимаем на нее два раза.
  6. Появится окно для редактирования значений переменной PATH, чтобы добавить новое значение воспользуйтесь кнопкой «Создать».
  7. Подтвердите добавление нового значения в переменную PATH нажатием кнопки «Ок» и закройте все остальные окна.
  8. Если во время редактирования переменной PATH у вас была запущена командная строка Windows, то закройте ее и откройте заново, чтобы cmd.exe прочитала новое значение переменной PATH.

Открываем поиск Windows и в форму пишем: «Система» или «Панель управления». В результате вы должны увидеть примерно такой результат, как показано на рисунке ниже.

Используем поиск Windows, ищем по ключевому слову Система

Используем поиск Windows, ищем по ключевому слову Система

После того, как вы нажмете на кнопку «Система», у вас появится окно, в левой части которого есть небольшое меню, самым нижним пунктом этого меню будет «Дополнительные параметры системы».

Чтобы добавить значение в переменную PATH переходим во вкладку Дополнительные параметры системы

Чтобы добавить значение в переменную PATH переходим во вкладку Дополнительные параметры системы

После перехода у вас появится окно поменьше, в этом окне нас интересует вкладка «Дополнительно». В правом нижнем углу есть кнопка «Переменные среды…», на нее и нажимаем.

Нажимаем на кнопку Переменные среды

Нажимаем на кнопку Переменные среды

Появится еще одно окно, которое позволяет управлять системными переменными Windows 10. Обратите внимание: в это окно разделено на две части, в верхней части происходит управление переменными среды для текущего пользователя, в нижней части расположены системные переменные.

В разделе Системные перемененные ищем переменную PATH

В разделе Системные перемененные ищем переменную PATH

В данном случае нас будет интересовать переменная Path, которая находится в разделе «Системные переменные», кликаем на нее два раза, у нас появляется окно, которое позволяет удалять, добавлять и редактировать значения системной переменной Path в Windows 10 и Windows 8. Нам осталось выполнить два действия: нажать на кнопку создать, в появившуюся активную форму вписать путь к файлу tracetcp.exe и подтвердить свои действия нажатием клавиши «Ок».

Дбовляем путь к исполняемому файлу в системную переменную PATH в Windows 10

Дбовляем путь к исполняемому файлу в системную переменную PATH в Windows 10

Закройте все остальные окна. Если у вас была открыта командная строка, вы можете убедиться в том, что она не увидела новое значение переменной PATH, попробуйте выполнить tracetcp из корня диска C, ничего не сработает. Когда вы добавляете новый путь в переменную PATH, программе cmd.exe нужно перечитать значения этой переменной, самый простой способ заключается в том, чтобы закрыть и заново открыть командую строку. Теперь команда tracetcp работает из любой папки, аналогично можно поступать и с другими программами командной строки, которые вы устанавливаете в Windows.

Как настроить переменную Path в Windows 7

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

  1. На вашем рабочем столе есть икнока с названием «Компьютер» или «Мой компьютер», нажмите на нее правой кнопкой мыши.
  2. Появится контекстное меню, в самом низу которого есть пункт «Свойства», выберете его.
  3. Перед вам развернется окно, в котором есть пункт меню «Дополнительные параметры системы», его и выбираем.
  4. В этом окне будет кнопка «Переменные среды», жмем на нее.
  5. У нас появляется окно управления системными переменными в Windows 7, внизу которого есть список переменных, среди которого нужно найти переменную PATH.
  6. Если такой переменной нет, то ее нужно создать, воспользовавшись кнопкой создать: у вас появится окно, в котором нужно будет вписать имя новой переменной, в нашем случае это Path.
  7. Если переменная PATH есть, то ее нужно выделить левой кнопкой мыши и нажать на кнопку изменить: появится небольшое окошко с двумя формами для ввода: верхняя форма содержит имя переменной — это Path. В нижней форме указаны абсолютные пути до исполняемых файлов различных программ, выглядет это примерно так: d:Program Filesapplication1;d:Program Filesapplication2;d:Program Filesaplication3; и так далее, чтобы добавить еще одно значение переместитесь в конец строки, убедитесь, что последним символом является «;» (именно этот символ является разделителем), впишите путь к исполняемому файлу (в моем случае он выглядел бы так: с:Program Filestracetcp) и в конце добавьте точку с запятой.
  8. Подтвердите свои действия нажатием кнопки «Ок» и закройте другие окна.

Как видите, настроить переменную PATH в Windows 7 не так уж и сложно.

Выводы

Вы этой статье мы разобрались с назначение системной переменной PATH и отметили, что в каждой операционной системе оно одинаковое и заключается в том, что переменная PATH является списком каталогов, в котором хранятся исполняемые файлы, если путь к исполняемому файлу есть в переменной PATH, то он может быть исполнен из командной строки операционной системы. Также мы разобрались с тем, как прописать путь к исполняемому файлу в операционных системах Windows 10, 8, 7.

Windows 7

  • From the desktop, right click the Computer icon.
  • Choose Properties from the context menu.
  • Click the Advanced system settings link.
  • Click Environment Variables.
  • In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.

How do I set the path in Windows 10?

Add to the PATH on Windows 10

  1. Open the Start Search, type in “env”, and choose “Edit the system environment variables”:
  2. Click the “Environment Variables…” button.
  3. Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit.
  4. The “Edit environment variable” UI will appear.

How can I change the path in CMD?

To access another drive, type the drive’s letter, followed by “:”. For instance, if you wanted to change the drive from “C:” to “D:”, you should type “d:” and then press Enter on your keyboard. To change the drive and the directory at the same time, use the cd command, followed by the “/d” switch.

How do I edit the path in Windows?

Finding the Windows Path Variable

  • Open the Start Menu.
  • Right-click on Computer and click Properties.
  • Click Advanced system settings.
  • Make sure you’re on the Advanced tab.
  • Click Environment Variables.
  • Under System variables, scroll to find the Path Variable.
  • Click on Path and then click Edit.

How do I find my path in CMD?

Command Prompt

  1. Open a Command Prompt window as administrator. Windows 10: press Win⊞ + S, type cmd, then press Ctrl + Shift + Enter. Or click Start, and click All Programs.
  2. Enter the command setx JAVA_HOME -m “Path” . For “Path”, paste in your Java installation path .

What is the PATH environment variable used for?

More specifally, it is an environment variable that is used across both Windows and Unix operating systems. Wikipedia has a halfway decent definition: PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located.

How do I set Java path in Windows 10?

How to set JAVA_HOME in Windows 10

  • Open Advanced System Settings. In Windows 10 press Windows key + Pause Key, This will open the System Settings window.
  • Set JAVA_HOME Environment variable. In “System Properties window” click “Environment Variables…”
  • Update System PATH.
  • Test your configuration.

Windows 10 and Windows 8

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables.
  4. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.

How do I set ADB path in Windows?

Adding adb and Fastboot to the Windows PATH (Method 2)

  • Open Windows Explorer and right click “My PC”.
  • Select “Advanced System Settings”.
  • Select “Environment Variables”
  • Look for the variable named “Path” and double click it.
  • Click “Browse” and navigate to the folder where you extracted your adb files.

How do I open a command prompt window in a folder?

In File Explorer, press and hold the Shift key, then right click or press and hold on a folder or drive that you want to open the command prompt at that location for, and click/tap on Open Command Prompt Here option.

How do I find the path in Windows?

From the Desktop, right-click the Start button and click System.

  1. After the System screen appears, select Advanced system settings.
  2. This will open the System Properties window.
  3. Under the System variables section, scroll down and highlight the Path variable.

Where is my python path windows?

Is Python in your PATH ?

  • In the command prompt, type python and press Enter .
  • In the Windows search bar, type in python.exe , but don’t click on it in the menu.
  • A window will open up with some files and folders: this should be where Python is installed.
  • From the main Windows menu, open the Control Panel:

How do I reset the PATH variable in Windows 10?

5 Answers

  1. In Windows 10 navigate to Start > Settings > Update & Security > Recovery.
  2. Under Advanced Startup, click Restart Now.
  3. Once the computer reboots into Advanced Startup, click Troubleshoot.
  4. Click Refresh Your PC.

How do I find my system path?

  • Right-click on the Start Button.
  • Select “System” from the context menu.
  • Click “Advanced system settings”
  • Go to the “Advanced” tab.
  • Click “Environment Variables…”
  • Click variable called “Path” and click “Edit…”
  • Click “New”
  • Enter the path to the folder containing the binary you want on your PATH.

How do I find Java path in Windows?

Add Java to the Windows Path

  1. Step 1: Load the System Properties.
  2. Step 2: Find the Advanced Tab in the Properties Window. Click Environmental Variables.
  3. Step 3: Scroll down in the System variables and find the PATH variable. Select the PATH variable and click the Edit button.
  4. Step 4: Add the Java installation path to the PATH variable.

What is add to PATH?

PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.

Why do we set PATH environment variable?

Environment variables are global system variables accessible by all the processes running under the Operating System (OS). Environment variables are useful to store system-wide values such as the directories to search for the executable programs ( PATH ) and the OS version.

What is path testing in software?

Path testing is an approach to testing where you ensure that every path through a program has been executed at least once. You normally use a dynamic analyzer tool or test coverage analyser to check that all of the code in a program has been executed. The starting point for path testing is a program flow graph.

What is the use of environment variables in Windows?

An environment variable is a dynamic “object” on a computer, containing an editable value, which may be used by one or more software programs in Windows. Environment variables help programs know what directory to install files in, where to store temporary files, and where to find user profile settings.

How do you check if Java_home is set correctly in Windows?

Windows

  • Check if JAVA_HOME is already set ,
  • Make sure you have installed Java already.
  • Right click on the My Computer icon on your desktop, then select Properties.
  • Click the Advanced Tab.
  • Click the Environment Variables button.
  • Under System Variable, click New.
  • Enter the variable name as JAVA_HOME.

What is the path for Java_home?

Set JAVA_HOME: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:Program FilesJavajdk1.6.0_02.

How do I change environment variables in Java?

For Windows:

  1. Right click on ‘My Computers’ and open ‘Properties’.
  2. In Windows Vista or Windows 7, go to “Advanced System Settings”.
  3. Go to ‘Advanced Tab’ and click on Environment Variables button.
  4. Select ‘Path’ under the list of ‘System Variables’, and press Edit and add C:Program Filesjavajdkbin after a semicolon.

How do I navigate to a folder in CMD?

To do this, open a command prompt from the keyboard by typing Win+R, or click on Start Run then type cmd in the run box and click OK. Navigate to the folder you want displayed in Windows Explorer by using the Change Directory command “cd” (with out the quotes).

How do I find a folder using command prompt?

HOW TO SEARCH FOR FILES FROM THE DOS COMMAND PROMPT

  • From the Start menu, choose All Programs→Accessories→Command Prompt.
  • Type CD and press Enter.
  • Type DIR and a space.
  • Type the name of the file you’re looking for.
  • Type another space and then /S, a space, and /P.
  • Press the Enter key.
  • Peruse the screen full of results.

How do I open a command window?

Start the Command Prompt using the Run window (all Windows versions) One of the quickest ways to launch the Command Prompt, in any modern version of Windows, is to use the Run window. A fast way to launch this window is to press the Win + R keys on your keyboard. Then, type cmd and press Enter or click/tap OK.

Where is my Java path in Windows?

Java and the Windows Command Prompt

  1. Select Start -> Computer -> System Properties -> Advanced system settings -> Environment Variables -> System variables -> PATH.
  2. Prepend C:Program FilesJavajdk1.6.0_27bin; to the beginning of the PATH variable.
  3. Click OK three times.

How do you check if Java is installed on Windows command prompt?

Checking the Java version on Windows

  • Log on to your MILS Windows Server 2008 machine as user pvadmin .
  • Open the Control Panel and click Programs and Features.
  • Search for Java .
  • Open a command prompt.
  • Enter the command java -version.

How do I know if Java is installed on Windows?

Q: How can I tell if Java Runtime Environment is installed on my Windows machine?

  1. Open the command prompt. Follow the menu path Start > Programs > Accessories > Command Prompt.
  2. Type: java -version and press Enter on your keyboard.

What is path math?

A path is a trail in which all vertices (except possibly the first and last) are distinct. A trail is a walk in which all edges are distinct. A walk of length in a graph is an alternating sequence of vertices and edges, , which begins and ends with vertices. If the graph is directed, then is an arc from to .

How do I add to my path in Windows 10?

Add to 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.

What is path stand for?

Program for Appropriate Technology in Health

How do I reset Windows environment variables?

Resetting the TEMP Environment Variable

  1. Choose Start > Settings > Control Panel.
  2. Double-click System.
  3. Click the Advanced tab, and then click Environment Variables.
  4. Under User Variables or System Variables, double-click the TEMP variable.
  5. Enter a valid directory, and then click OK.
  6. Restart the Silk Test installation by double-clicking the EXE file.

How do Environment variables work?

A running program can access the values of environment variables for configuration purposes. Shell scripts and batch files use environment variables to communicate data and preferences to child processes.

What are environment variables in Windows 10?

Use these environment variables to quickly browse Windows 10 locations on any computer. On Windows 10, environment variables are predefined names that represent the path to certain locations within the operating system, such as to a drive or a particular file or folder.

Photo in the article by “National Park Service” https://www.nps.gov/gett/learn/management/2017-year-in-review.htm

Cover image for Adding Files to the PATH on Windows 10

Ben Soyka

As a Windows user, you’ll often find the need to add executables and other files to your system PATH. This means you can access them from any location in the command prompt.

Often, program installers will do this for you. For example, the Python installer has a checkbox to add Python to your PATH variable automatically.

In the case you need to manually add to your PATH, here are some simple instructions:


Make/find a folder

You can’t directly add files to the PATH variable, only folders. So, start off by finding the folder where your file is located.

If you simply downloaded the file, it’s recommended that you make a folder in another location such as your Documents folder.

Get the folder path

By clicking on the «address bar» in the file explorer, you can get the folder’s path.

Screenshot

Navigate to «Advanced system settings»

Right-click on the Windows logo to show a new menu. Choose the «System» option. Once the Settings app opens up, choose the «System info» link.

This will open up a Control Panel page where you can view information about your device, and more importantly, change a few advanced settings. Click the appropriate link to visit that menu.

Screenshot

Once here, click on the button at the bottom to open the Environment Variables menu. With this new menu open, select the PATH variable in the first list and click the Edit button.

Press the New button, paste in the folder path from earlier, and press Enter. Press OK a few times and you’re done!


Now that you’ve added your folder to the PATH variable, any files you add there will be accessible from the command prompt no matter where you are on your computer.

We want your help! Become a Tag Moderator.
Check out this survey and help us moderate our community by becoming a tag moderator here at DEV.

Introduction 

Recently, I needed to add a directory to the PATH system variable of Windows 10. The PATH is a system variable that allows Windows to locate executables from the command line or the Terminal window.

In this article, I will show you how to add a folder to the Windows 10 PATH variable.

Step 1. Press WIN+S to launch Windows Search on your Windows 10 machine. You will see Search Textbox.

Windows 10 Search Box 

Step 2. Type “environ..” in the Windows Search Textbox. You will see “Edit the system environment variables” as a result of the Best match list. Select this option.

Windows 10 Search Results 

Step 3. This will launch the System Properties window. On this window, we can review Computer Name, Hardware, and other Advanced properties.

Windows 10 Advanced Properties 

On the Advanced tab, we can set Performance, User Profiles, and Startup and Recovery options. The last button is the Environment Variables. Click on this button.

Step 4. It will launch the Environment Variables window where you can see all variables and their values. As you can see from the following window, there are User variables and System variables.

Windows 10 Environment Variable

In System variables, one of the variables is Path. See in the above image.

Step 5. Double click on the Path variable.

You will see a list of all Path variables where you can edit them, add a new Path variable, and delete an existing variable.

Windows 10 Path Variables 

Step 6. Click on New button. It will enter a new editable row where you can type a new path.

Path in Windows 10 

Step 7. Click OK. Your PATH variable is now added.

Watch this video for more details: 

В различных руководствах и документациях часто встречается пункт «добавьте путь до чего либо в переменную PATH». Что это за переменная и как в нее что-то добавить описано ниже, в этой заметке.

Что такое переменная PATH и для чего она нужна?

Если коротко, то PATH это такая переменная, с помощью нее операционная система ищет  исполняемые объекты, которые вы пытаетесь вызвать в командной строке.

Другими словами, PATH позволяет запускать исполняемые файлы, без указания их точного местоположения на диске. Например, после установки Python на Windows, для выполнения скрипта Питона нам достаточно в командной строке набрать:

python имя_выполняемого_файла.py

Нам не пришлось указывать точного пути до интерпретатора Питона (в моем случае C:UsersAlexAppDataLocalProgramsPythonPython37-32python.exe) как раз из-за установленной переменной PATH.

соответствующую программу. Этим можно воспользоваться в своих целях двумя способами:

Как добавить PHP в системные переменные среды?

Для примера добавим PHP в переменную PATH.

У меня на компьютере интерпретатор php располагается в каталоге C:xamppphp72, поэтому чтобы выполнить php скрипт в командной строке, мне нужно ввести:

C:xamppphp72php.exe имя_скрипта.php

Но согласитесь, гораздо удобней так:

php имя_скрипта.php

К тому же некоторые программы, например IDE будут автоматически «понимать» где расположен интерпретатор php.

Итак, чтобы добраться до настроек переменной PATH, нам сначала нужно открыть Панель управления Windows, поскольку Микрософт постоянно меняет ее положение, проще всего найти ее через поиск:

Панель управления Windows 10 через поиск

Далее нужно выбрать Система -> Дополнительные параметры системы.

Дополнительные параметры системы Windows 10

В последних версия Windows 10 Дополнительные параметры системы открываются по такому пути:

Сначала открываете Все параметры -> Система, далее слева внизу выбираете О программе и справа в списке будет нужный пункт Дополнительные параметры системы.

Дополнительные параметры системы Windows 10

В открывшемся окне Свойства системы нужно выбрать вкладку Дополнительно и внизу будет кнопка Переменные среды.

Переменные среды Windows 10

Выбираем переменную среды Path и нажимаем Изменить. После этого нажимаем кнопку Создать и вводим пусть до папки, где расположен наш интерпретатор PHP, в моем случае C:xamppphp72.

Далее везде нажимаем ОК, все, переменная среды для PHP сохранена.

Теперь, если перезапустить командную строку, можно выполнять php скрипты не указывая полного пусти к интерпретатору.

php hello.php

На чтение 3 мин Просмотров 1.4к. Опубликовано 04.04.2016

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

Содержание

  1. Что такое PATH система Windows?
  2. Как добавить папку в PATH?
  3. Path в операционной системе Windows 7 и Windows 8
  4. Path в операционной системе Windows 10

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

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

C:Androidplatform-toolsadb.exe

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

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

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

ADB

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

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

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

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

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

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

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

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

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

C:Androidplatform-tools

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

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

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

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

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

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

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

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

Содержание

Введение
Для чего используется
Пример
Добавить директорию в PATH
Изучить содержимое PATH
Ошибки
Postgesql
Похожие статьи

Введение

Если Вам нужно настроить PATH в Linux — перейдите

сюда

Для чего используется

Когда Вы выполняете какую-либо команду в консоли, система ищет соответствие
между названием этой команды и программой, которую можно выполнить.

Искать по всему жёсткому диску было бы слишком долго, поэтому поиск
осуществляется только по некоторым директориям.

Список этих особых директорий хранится в системной переменной PATH.

Пример

Предположим, что возникла необходимость запускать какую-то программу, например

Firefox

, непосредственно из командной строки.

Без предварительной подготовки ввод Firefox в консоль выдаст ошибку.

C:Usersa>firefox

‘firefox’ is not recognized as an internal or external command, operable program or batch file.

Чтобы решить эту проблему нужно добавить директорию с испоняемым файлом firefox в PATH

Добавить директорию в PATH

Быстрый способ перейти к редактированию PATH — нажать клавишу Win и ввести в поиск env

Env с сайта www.andreyolegovich.ru

Пошаговый способ:

Правый клик на Этот Компьютер (This PC) → Свойства (Properties)

Мой компьютер Свойства изображение с сайта www.andreyolegovich.ru

Дополнительные параметры системы (Advanced system settings)

Control Panel - All Control Panel Items - System изображение с сайта www.andreyolegovich.ru

Дополнительно (Advanced) → Переменные среды (Environment Variables)

Environment Variables изображение с сайта www.andreyolegovich.ru

Если хотите менять для всей системы, то в окошке «Переменные среды»
(System Variables)
найдите строку PATH в блоке
«Системные переменные» (System variables)
выделите кликом и нажмите кнопку «Изменить…» (Edit…)

Если хотите менять только для своего пользователя, то делайте это в блоке
«Переменные среды пользователя %USERNAME%» (User variables for %USERNAME%)

Environment Variables изображение с сайта www.andreyolegovich.ru

Создайте новый путь (New)

Path Environment Variable изображение с сайта www.andreyolegovich.ru

Введите адрес директории в которой лежит нужная программа. В нашем случае это

C:Program Files (x86)Mozilla Firefox

Path Environment Variable изображение с сайта www.andreyolegovich.ru

Перезапустите консоль или открываем новую и пишем там firefox.

C:Usersa>firefox

Браузер должен запуститься.

Изучить содержимое PATH

В

PowerShell

достаточно выполнить

echo $Env:Path

C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;

Или

Get-ChildItem Env:Path

Name Value
—- ——
Path C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPo…

В cmd.exe посмотреть список переменных
окружения можно выполнив команду

set

без параметров.

set

Выдача содержит системные переменные и переменные пользователя
а также дополнительную информацию. Содержимое PATH выделено зелёным.

результат выдачи команды set без параметров

Ошибки

-bash: syntax error near unexpected token `(‘

Скорее всего Вы пытаетесь добавить в unix PATH адрес из Windows, c пробелами, скобками и так далее.

Например:

andrey@olegovich-10:/usr/share$ export PATH=/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_1128437:$PATH

-bash: syntax error near unexpected token `(‘

Для решения этой проблемы Вам нужно экранировать пробелы и скобки. Если импортируется много путей и ввод очень длинный —
немного проще записать PATH=$PATH:/путь , если Вам подходит запись в конец.

Также нужно помнить, что все лишние пробелы сломают импорт — для проверки можно сделать весь скрипт в одну строку
в текстовом редакторе.

Также стоит помнить, что если Вы работаете в

bash под Windows
,
то переменные окружения нужно задавать через Windows.

andrey@olegovich-10:/usr/share$ export PATH=$PATH:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_1128437

Postgesql

Приведу пример для использования psql из

bash под Windows

— это может пригодиться если Вы хотите временно добавить
путь к psql в PATH чтобы запустить

Postrgres

скрипт.

В моём случае

psql.exe

находится в папке C:Program FilesPostgreSQL12bin

PATH=$PATH:/mnt/c/Program Files/PostgreSQL/12/bin

Похожие статьи

Windows
Loudness Equalization
PowerShell
Посмотреть конец файла в PowerShell (аналог tail)
Создать новый файл в PowerShell (аналог touch)
Проверить контрольную сумму файла в PowerShell (аналог md5sum)
Windows Firewall
Remote Desktop Protocol
Драйверы в Windows
Режим разработчика в Windows 10
BASH в Windows 10
Telnet в Windows 10
Системная переменная PATH
Установка Windows на gpt диск
batch file
pstools
Удалённый рабочий стол
Горячие клавиши

Понравилась статья? Поделить с друзьями:
  • Adb драйвера скачать для windows xp x32
  • Adb драйвера скачать для windows 7 на русском
  • Adb драйвера скачать для windows 10 x64 xiaomi
  • Adb драйвера скачать для windows 10 x64 samsung
  • Adb драйвера для андроид скачать для windows 10