Understanding environment variable precedence in Windows XP
Takeaway: Have you ever set an environment variable in the Autoexec.bat file and then discovered that the variable has a different value than the one you specified? This is because the variable was probably overridden by the same setting in the Environment Variables dialog box. Discover how to avoid such problems.
Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!
Many IT pros still use the Autoexec.bat file to set environment variables, which is fine in most cases. However, if you set an environment variable in the Autoexec.bat file and then discover that the variable has a different value than the one you specified, the variable was probably overridden by the same setting in the Environment Variables dialog box.
This is because during the startup procedure Windows XP searches the startup files and processes the environment variable settings in the following order:
- Autoexec.bat files
- System Variables
- User Variables
Therefore, if you set the same environment variable in the Autoexec.bat file and in the System Variables section, the value assigned in the System Variables section will override the value assigned in the Autoexec.bat file.
To avoid these types of problems, you might want to get into the habit of setting environment variables in the Environment Variables dialog box. Here's how:
- Right-click My Computer and select Properties to open the System Properties dialog box.
- Select the Advanced tab and press the Environment Variables button.
From the Environment Variables dialog box, you can set user-specific variables or system-specific variables by pressing the New or Edit buttons and then selecting OK.
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- Microsoft SQL Server 2005: Deployment and Tests in an iSCSI SAN Dell EqualLogic
- Sprint DataLink for Wireless WAN Fact Sheet Sprint
- Yankee Group: Exploring the Benefits of 3G Wireless Integrated into Business-Class Routers Sprint
- Leveraging Information for Innovation and Competitive Advantage IBM
- Live Webcast: Top Ten Challenges with On-Premise Email Management Dell MessageOne
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET





