Solved

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

Posted on 2003-11-07
6
817 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
Comment Utility

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
Comment Utility
I can't install setX on clients so this won't work (which are XP), but thanks
0
 
LVL 5

Expert Comment

by:brianadkins
Comment Utility

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:panhead28
Comment Utility
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
Comment Utility
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
Comment Utility
Hi panhead,

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

16 Experts available now in Live!

Get 1:1 Help Now