Solved

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

Posted on 2003-11-07
6
824 Views
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:

C:\PROGRA~1\Borland\CBUILD~1\Bin;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;C:\mysql\bin

thanks
0
Comment
Question by:panhead28
  • 2
  • 2
  • 2
6 Comments
 
LVL 5

Expert Comment

by:brianadkins
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

-Brian
0
 

Author Comment

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

Expert Comment

by:brianadkins
ID: 9706737

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

\\servername\utilities\setx.exe

-Brian
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:panhead28
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.
0
 
LVL 1

Accepted Solution

by:
Imhotep earned 125 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?
0
 
LVL 1

Expert Comment

by:Imhotep
ID: 9709598
Hi panhead,

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now