- How to set the path and environment variables in Windows
- Setting the path and variables in Windows 10
- Setting the path and variables in Windows 8
- Setting the path and variables in Windows Vista and Windows 7
- Setting the path and variables in Windows 2000 and Windows XP
- What is the default Windows %PATH%?
- Setting path in the MS-DOS and Windows command line
- Изучаем переменные среды в Windows 10
- Переменные среды Windows
- Переменные PATH и PATHEXT
- Создание переменных среды
- Заключение
- How to edit system environment path variables on Windows 10
- How can I edit the path environment variable in Windows 10?
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
- From the desktop, right-click the very bottom-left corner of the screen to get the Power User Task Menu.
- From the Power User Task Menu, click System.
- In the Settings window, scroll down to the Related settings section and click the System info link.
- In the System window, click the Advanced system settings link in the left navigation pane.
- In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
- 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
- From the desktop, right-click the very bottom-left corner of the screen to get the Power User Task Menu.
- From the Power User Task Menu, click System.
- Click the Advanced System Settings link in the left column.
- In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
- 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
- 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.
- Click the Advanced System Settings link in the left column.
- In the System Properties window, click the Advanced tab, then click the Environment Variablesbutton near the bottom of that tab.
- 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.
- 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.
- In the System Propertieswindow, click the Advancedtab.
- In the Advanced section, click the Environment Variablesbutton.
- 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.
Изучаем переменные среды в Windows 10
Переменные среды Windows
Получить информацию о существующих переменных можно в свойствах системы. Для этого кликаем по ярлыку Компьютера на рабочем столе правой кнопкой мыши и выбираем соответствующий пункт.
Переходим в «Дополнительные параметры».
В открывшемся окне с вкладкой «Дополнительно» нажимаем кнопку, указанную на скриншоте ниже.
Здесь мы видим два блока. Первый содержит пользовательские переменные, а второй системные.
Если требуется просмотреть весь перечень, запускаем «Командную строку» от имени администратора и выполняем команду (вводим и нажимаем ENTER).
На рабочем столе появится файл с названием «set.txt», в котором будут указаны все переменные окружения, имеющиеся в системе.
Все их можно использовать в консоли или скриптах для запуска программ или поиска объектов, заключив имя в знаки процента. Например, в команде выше вместо пути
Примечание: регистр при написании переменных не важен. Path=path=PATH
Переменные PATH и PATHEXT
Если с обычными переменными все понятно (одна ссылка – одно значение), то эти две стоят особняком. При детальном рассмотрении видно, что они ссылаются сразу на несколько объектов. Давайте разберемся, как это работает.
«PATH» позволяет запускать исполняемые файлы и скрипты, «лежащие» в определенных каталогах, без указания их точного местоположения. Например, если ввести в «Командную строку»
система осуществит поиск по папкам, указанным в значении переменной, найдет и запустит соответствующую программу. Этим можно воспользоваться в своих целях двумя способами:
- Поместить необходимый файл в одну из указанных директорий. Полный список можно получить, выделив переменную и нажав «Изменить».
Создать свою папку в любом месте и прописать путь к ней. Для этого (после создания директории на диске) жмем «Создать», вводим адрес и ОК.
%SYSTEMROOT% определяет путь до папки «Windows» независимо от буквы диска.
Затем нажимаем ОК в окнах «Переменные среды» и «Свойства системы».
Для применения настроек, возможно, придется перезапустить «Проводник». Сделать это быстро можно так:
Открываем «Командную строку» и пишем команду
taskkill /F /IM explorer.exe
Все папки и «Панель задач» исчезнут. Далее снова запускаем «Проводник».
Еще один момент: если вы работали с «Командной строкой», ее также следует перезапустить, то есть консоль не будет «знать», что настройки изменились. Это же касается и фреймворков, в которых вы отлаживаете свой код. Также можно перезагрузить компьютер или выйти и снова зайти в систему.
Теперь все файлы, помещенные в «C:\Script» можно будет открывать (запускать), введя только их название.
«PATHEXT», в свою очередь, дает возможность не указывать даже расширение файла, если оно прописано в ее значениях.
Принцип работы следующий: система перебирает расширения по очереди, пока не будет найден соответствующий объект, причем делает это в директориях, указанных в «PATH».
Создание переменных среды
Создаются переменные просто:
- Нажимаем кнопку «Создать». Сделать это можно как в пользовательском разделе, так и в системном.
Вводим имя, например, «desktop». Обратите внимание на то, чтобы такое название еще не было использовано (просмотрите списки).
В поле «Значение» указываем путь до папки «Рабочий стол».
Нажимаем ОК. Повторяем это действие во всех открытых окнах (см. выше).
Для примера переделаем команду, которую мы использовали для получения списка (самая первая в статье). Теперь нам вместо
потребуется ввести только
Заключение
Использование переменных окружения позволяет значительно сэкономить время при написании скриптов или взаимодействии с системной консолью. Еще одним плюсом является оптимизация создаваемого кода. Имейте в виду, что созданные вами переменные отсутствуют на других компьютерах, и сценарии (скрипты, приложения) с их использованием работать не будут, поэтому перед тем, как передавать файлы другому пользователю, необходимо уведомить его об этом и предложить создать соответствующий элемент в своей системе.
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.
- Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
- Click Start Scan to find Windows issues that could be causing PC problems.
- 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?
- In the Windows search box type advanced system settings and select View advanced system settings to open the window in the shot below.
- Press the Environment Variables button to open the window shown below.
- There you can select Path in the System variables box. Selecting Path and pressing the Edit button opens the window shown directly below.
- 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.
- 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).
- Select a folder that includes third-party software in the Browse for Folder window. For example, we selected a folder that includes Firefox.
- 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).
- Press the OK button on Edit environment variable window to close it.
- Click the OK buttons on the Environment Variables and System Properties windows to close them.
- Type cmd in the Windows search box and click on Command Prompt on that menu to open it as below.
- 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.