1.

Solve : Set Path from cmd line?

Answer»

Hello ,
i want to set a path by using the set command in winxp from commandline, say i want a folder named uha in c drive: something like this c:\uha. How should i do it. Also few questions, like whether it is permanent or temporary, and if permanent how can i remove it from the path.Please help..

Thank you. You can add a folder to the %PATH% environment variable like this

set path=%PATH%;c:\uha

or if you prefer

set path=c:\uha;%PATH%

It will only be temporary, until the command session is ended. Other command sessions opened separately will not see the change.


If you want to completely replace the %PATH% variable you WOULD do this

set path=c:\uha

but be prepared for many commands and utitlities to not work.

If the folder has one or more spaces surround it in quotes.




Quote from: Salmon Trout on October 19, 2012, 01:09:56 PM

You can add a folder to the %PATH% environment variable like this

set path=%PATH%;c:\uha

or if you prefer

set path=c:\uha;%PATH%

It will only be temporary, until the command session is ended. Other command sessions opened separately will not see the change.


If you want to completely replace the %PATH% variable you would do this

set path=c:\uha

but be prepared for many commands and utitlities to not work.

If the folder has one or more spaces surround it in quotes.

Thank you Salmon, that was great, now i can set path to any folder from the cmdline.Too bad its not permanent.Quote from: Floppyman on October 20, 2012, 12:43:04 PM
Too bad its not permanent.

In XP you can do that like this

Right-click My Computer, and then click PROPERTIES.
Click the ADVANCED tab.
Click Environment variables.
Click the Path variable
Click Edit to change its value, adding your folder to the start or end, using a semicolon as separator as I showed above.
Then keep clicking OK buttons to go right back out









For Win 7 and Vista?, and when using the resource kit in XP there is a command called SETX which will set a variable in the master environment from the command LINE, too.Thank you Salmon, but i know the second way i.e., from My Computer and then properties, i just wanted to know from the command line . Any ways this site is great, great place to share knowledge.

Thanks once again.Quote from: Floppyman on October 21, 2012, 12:23:58 PM
i just wanted to know from the command line

As foxi said, setx.exe is the command line tool

Windows XP Service Pack 2 Support Tools

http://www.microsoft.com/en-us/download/details.aspx?id=18546



Discussion

No Comment Found