Environment variables are set in the following order:
1. Dynamic variables that the operating system defines, like %DATE% and %TIME%, are established first.
2. System variables from Control Panel / System are set next.
3. Autoexec.bat variables are next, unless you have ignored them.
4. User variables from Control Panel / System are set last.
NOTE: If the same variable is defined in multiple places, the last value set takes precedence.