Solved

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

Posted on 2003-11-07
6
821 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel: Move files in a folder 8 71
Filter echo results from batch file output 7 59
Build VS2015 project in bat command 3 80
how to pick only current date files from a ftp 14 54
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

27 Experts available now in Live!

Get 1:1 Help Now