Jump to content

%Windir% vs %SystemRoot%


Recommended Posts


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 been

on a different drive, eg. D:\Windows, while the DOS operating system

exisited 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 TAB

and 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 by Shark007
Link to comment
Share on other sites

%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 by MHz
Link to comment
Share on other sites

  • 3 years later...

(old topic, I know)

was wondering about that %windir% vs %systemroot% too... did some google search and found this topic :thumbup

very clear now, particularly due to this part:

if you go to: My Computer / Properties / Advanced TAB

and 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 :whistle:), but now will use %systemroot% (cleaner)

cheers

Edited by OuTmAn
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...