View Full Version : Batch Program to Add to Environment Variables
07-29-2007, 12:52 PM
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.
07-29-2007, 06: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.
07-30-2007, 02: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
07-30-2007, 04: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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.