Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-11-07
6
Medium Priority
?
838 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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 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?
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

876 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