vcBlackBox Posted August 8, 2005 Posted August 8, 2005 Like the title says, %Windir% vs %SystemRoot%Is one better than the other one and why?
Shark007 Posted August 8, 2005 Posted August 8, 2005 (edited) This one puzzles me also... after a bit of google'ing I've come up with:SYSTEMROOT = System returns the location of the Windows root directory. WINDIR = System returns the location of the OS directory.They mean the same thing (today).I'm thinking, back in the pre32bit operating system days the windir may have beenon a different drive, eg. D:\Windows, while the DOS operating systemexisited in the C:\dos directory.Or, i may be completely out to lunch.also: just for reference, if you go to: My Computer / Properties / Advanced TABand click on 'Environment Variables' and scroll the lower window to the bottom,you find 'windir'.Double clicking this results in the windir variable having a value of '%systemroot%leading me to believe %systemroot% is the 'basis' for this variable.Shark Edited August 8, 2005 by Shark007
SiMoNsAyS Posted August 9, 2005 Posted August 9, 2005 basically, you can use %systemroot% from the very first step on the setup.however %windir% is only available after T-13 (or that's what i think at least )
MHz Posted August 9, 2005 Posted August 9, 2005 (edited) %WinDir% is old dated environment variable for the Windows folder.%SystemRoot% is the newer dated environment variable for the Windows folder.%WinDir% remains in use, to allow batch scripts to run on both NT and 9x systems. If you use an NT command script, then %SystemRoot% would be more suitable to use.I would expect all system environment variables to be available at the same time.Windows NT and Windows 2000 do not have a Windows directory, so %WinDir% would have been strange? They have WinNT folders instead, which may have prompted the change? Edited August 9, 2005 by MHz
vcBlackBox Posted August 9, 2005 Author Posted August 9, 2005 Cool, thanks.I was just worried that one variable might depending on the situation, give a slightly different location than the other one. Thanks for clarifying.
OuTmAn Posted October 6, 2008 Posted October 6, 2008 (edited) (old topic, I know)was wondering about that %windir% vs %systemroot% too... did some google search and found this topic very clear now, particularly due to this part:if you go to: My Computer / Properties / Advanced TABand click on 'Environment Variables' and scroll the lower window to the bottom,you find 'windir'.Double clicking this results in the windir variable having a value of '%systemroot%leading me to believe %systemroot% is the 'basis' for this variable.I was using %windir% before (because shorter ), but now will use %systemroot% (cleaner)cheers Edited October 6, 2008 by OuTmAn
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now