...

View Full Version : Batch Program to Add to Environment Variables



StupidRalph
07-29-2007, 11:52 AM
How would I go about writing a batch program (or whatever needs to be written) that adds to the system's environment PATH variable permanently? I was trying to use SET but that only adds for the current CMD.exe session. I'm planning on having the (windows) users enter the path to their PHP and MySQL executables and then add those paths to the windows environment %path%. That way they can use php and mysql from the command line by simply typing in php and mysql as the command instead of the complete path.

FishMonger
07-29-2007, 05:43 PM
If PHP and MySQL were installed properly, they should already be in the path environment. If not, then the administrator of the box should fix it. You should not create a batch file to do this.

Right click the "My Computer" icon on the desktop and select 'Properties'.
Click on the "Advanced" tab then "Environment Veriables".
In the "System Variables" scroll down to the 'Path' environment and edit it as needed.

StupidRalph
07-30-2007, 01:38 AM
Hmmm I guess the (PHP and MySQL) installers doesn't (or at least didn't when I installed) set them in the Path. Yeah, I've actually did a video showing them how to manually do it themselves, but someone asked if I could write a batch file to have this done automatically. I could use SETX but thats not guaranteed to be on everyone's systems. I'll just let them watch the tutorial and post additional questions but I think its straight forward. Thanks

bcarl314
07-30-2007, 03:09 AM
It's been a while since I actually configured a windows box, but I recall there is some startup batch file that does some of the PATH configurations - autoexec.bat perhaps? I'm not sure on the name, but I know windows (at least up to Win2k) had such a file.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum