7
I wonder how I can change the variable PATH
in the Windows environment.
I am a linux user but I know that windows also allows the use of this environment variable to find its executables.
7
I wonder how I can change the variable PATH
in the Windows environment.
I am a linux user but I know that windows also allows the use of this environment variable to find its executables.
16
If you want to change the PATH
from the command line/from inside your program calling the shell, the command is this:
set PATH=%PATH%;C:\minha\nova\pasta
The set
serves to assign values to environment variables; on the right side, the %PATH%
reads the value of the variable PATH
and includes her in the list (so that she will have the old ways and the new path you are adding). And folders in Windows are separated by ;
(and not by :
as in *NIX). Note that this change is temporary (i.e. is valid until you close the terminal/your program finishes running).
If your intention is to change this variable permanently (for all users or for a specific user), then look for the instructions for your specific Windows version (the other answers also give examples). If you want to do this programmatically, then you may need to tinker with Windows records. See this question in the SOEN for more details. An answer indicates that it is possible to use the command setx
instead of the set
to make the change permanent, I cannot confirm this as I have never used this command before (nor do I know from which version it is available):
setx PATH "%PATH%;C:\minha\nova\pasta"
setx PATH "%PATH%;C:\minha\nova\pasta" /m
(the first changes only for current user, the second for all users)
I chose yours because it is the best answer indeed and it applies to all available windows versions. Thank you for the reply.
+1 because cited alternative to define permanently via command line. I would even reply set PATH=%PATH%;XPTO
but with standard cmd there is no way to permanently define how it happens in Linux. You bypassed it.
9
Basically you have to access the environment variables, regardless of the Windows you are using.
Right-click the Computer and choose Properties:
Choose "Advanced System Settings"
Will open the following window:
Click environment variables, the following window will open:
Select Path and click Edit
+1 very well formulated illustrated reply. Thank you
5
Follow these steps (Windows 7):
Knob
Iniciar
Right mouse button onComputador
On the left side of the screen that appeared to chooseDefinições avançadas do sistema
ChooseVariáveis de ambiente
Cool, I didn’t know that in Portugal called the "mouse" mouse. Here in Brazil we call the mouse.
+1 quick and assertive response.
@Maicon Carraro It is the old question about what should be translated or not. I had noticed that there are terms that Brazilians translate and Portuguese do not and vice versa.
5
Can be changed modifying the system record in all versions of Windows, this way making up permanent the change.
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
and change the variable Path
.
4
Windows 8
Arraste o ponteiro do Mouse até o canto inferior Direito da tela
Clique no ícone Pesquisar e digite Painel de Controle
Clique em -> Painel de Controle -> Sistema -> Avançado
Clique em Variáveis de Ambiente, em Variáveis do Sistema, localize PATH e clique nele.
Na janelas Editar, modifique PATH adicionando a localização da classe para o valor de PATH. Caso você não tenha o item PATH, será possível optar por adicionar uma nova variável e adicionar PATH como o nome e o local da classe como o valor.
Feche a janela.
Windows 7
Selecione Computador no menu Iniciar
Escolha Propriedades do Sistema no menu de contexto
Clique na guia Definições avançadas do sistema > Avançado
Clique em Variáveis de Ambiente, em Variáveis do Sistema, localize PATH e clique nele.
Na janelas Editar, modifique PATH adicionando a localização da classe para o valor de PATH. Caso você não tenha o item PATH, será possível optar por adicionar uma nova variável e adicionar PATH como o nome e o local da classe como o valor.
Windows XP
Iniciar -> Painel de Controle -> Sistema -> Avançado
Clique em Variáveis de Ambiente, em Variáveis do Sistema, localize PATH e clique nele.
Na janelas Editar, modifique PATH adicionando a localização da classe para o valor de PATH. Caso você não tenha o item PATH, será possível optar por adicionar uma nova variável e adicionar PATH como o nome e o local da classe como o valor.
Feche a janela.
Windows Vista
Clique com o botão direito do mouse no ícone Meu computador
Escolha Propriedades no menu de contexto
Clique na guia Avançado (link Definições avançadas do sistema no Vista)
Na janelas Editar, modifique PATH adicionando a localização da classe para o valor de PATH. Caso você não tenha o item PATH, será possível optar por adicionar uma nova variável e adicionar PATH como o nome e o local da classe como o valor.
+1 we ended up finding from the same source this answer, Java site.
Hehe, yeah, yeah, yeah...
2
Windows 8
PATH
and click on it.PATH
adding the class location to the value of PATH
. If you don’t have the item PATH
, you can choose to add a new variable and add PATH
as the name and location of the class as the value.Windows 7
PATH
and click on it.PATH
. If you don’t have the item PATH
, you can choose to add a new variable and add PATH
as the name and location of the class as the value.Windows XP
PATH
and click on it.PATH
adding the class location to the value of PATH
. If you don’t have the item PATH
, you can choose to add a new variable and add PATH
as the name and location of the class as the value.Windows Vista
PATH
adding the class location to the value of PATH
. If you don’t have the item PATH
, you can choose to add a new variable and add PATH
as the name and location of the class as the value.Browser other questions tagged windows path
You are not signed in. Login or sign up in order to post.
Which windows you are using?
– Math