I wanted to do it using .BAT file ( so user clicks it and does it automatically - instead of manually putting in EV screen in windows )
Main Topics
Browse All TopicsHow can we set a path permanently using .BAT file.
I wanted to add a folder bin directory to the existing PATH in my system variables, how can I do this using BATCH(.BAT) file ?
I don't want this as a runtime variable, it needs to be set permanently using the .BAT file.
Example:- My current PATH=c:\windows;c:\windows
I wanted to add C:\ABC\BIN to the above path and make the
PATH=c:\windows;c:\windows
Let me know
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The path can not be set "permanently" using your custom .BAT file.
As soon as you close your Command Prompt / Console, the PATH variable is reverted back to the value set in the Environment Variables for the machine. (Control Panel->System->Advanced->Envi
However, the PATH can be set for the session or time for which you use the Command Prompt by adding the following line to your .BAT file.
set PATH=%PATH%;C:\ABC\BIN
In older DOS machines and Windows 95/98/ME machines, this variable (PATH) or any other system environment variable could be set permanently by using the AUTOEXEC.BAT file which is executed at the system boot time.
I need a solution to set the Environmental variables what I am setting should effect permanently.
Either it could be a batch file or registry file what ever it may be, but should be once click solution for the users not setting manually using command prompt.
The solution should work with windows 2000 and above including servers!
Hi,
It's possible to change the registry key for environmental directly by dowing following:
Add the code snippet to a simple text file and save it as a .reg file. Double click on the file will prompt you whether you really want to change registry values. Choosing "Yes" will set your registry PATH value with desired path.
However, this is not advised as the data type of the PATH variable will be changed to REG_SZ. It should be REG_EXPAND_SZ which helps to expand included system variabes in the PATH variable. The value for this types are stored as hex characters in the registry.
PS: It is advisable to take a back up of your registry before you make any changes.
Business Accounts
Answer for Membership
by: melchkishorePosted on 2008-07-21 at 09:09:51ID: 22051803
put the same in environment variable and try.