How can I append a value to Path variable in Registry?

Posted on 2003-11-07
Medium Priority
Last Modified: 2009-07-29
I want to create a batch file that will append a value to the existing Path variable.

For example, my current Path value is "C:\PROGRA~1\Borland\CBUILD~1\Bin;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl".

I want to append the value "C:\mysql\bin" to whatever the value is on a given system.  If I were to run this batch file on my system, the value would become:


Question by:panhead28
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2

Expert Comment

ID: 9704196

You could try setx from the Win2000 resource kit

[ http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.asp ]

setx path %path%;C:\mysql\bin -m

    or, if your path had any spaces in it:

setx path "%path%;C:\mysql\bin" -m

the [-m] sets the value for all users


Author Comment

ID: 9705939
I can't install setX on clients so this won't work (which are XP), but thanks

Expert Comment

ID: 9706737

Could you just leave setx.exe on a central network share and have the clients run it from there?


 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


Author Comment

ID: 9707771
No, thats not possible.  What I am trying to do is create an install cd that will install a custom app and a mysql db.  I want the batch files to append the path variable, and then run the .sql scripts.  The cd will be mailed out to distributors across the US to demo the app.

Accepted Solution

Imhotep earned 250 total points
ID: 9708331
It seems as if you want to start the Demo executing the batch file. Then why don't you just place a

set Path=%Path%;c:\mysql\bin

right before your script calls? then the path is only set locally, but it should be enough.

alternatively, doesn't mysql provide a possibility to set the path with its installation?

Expert Comment

ID: 9709598
Hi panhead,

thx for the points, but why is it a grade C? Aren't you satisfied with the answer?

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question