On my computer, these two variables gives the same result:
echo %HomeDrive% -> C:
echo %SystemDrive% -> C:Is there any difference between them?
Reference links are welcome, because it's too easy to say something like "yes, they are the same" just because they are the same on one's particular computer.
12 Answers
Big difference.
The %systemdrive% (typically c:) is the partition with the %systemroot% (typically Windows) directory.
%homedrive% is typically your network root profile directory, in an (Active Directory) Domain, it would reside on a server.
The web links to their expanded descriptions are rich and voluminous, you could easily find more info about them at Microsoft.com.
2In answer to @StevenPenny asking for sourced answers: There are surprisingly few such, and almost none from Microsoft. Below are a few sources.
One of the few sources by Microsoft:
%systemdrive% is defined as the drive that contains the Windows directory.
On a Microsoft Windows system, the %HOMEPATH% is the name for what Unix/Linux users call $HOME. When combined with the %HOMEDRIVE% environment variable you get a complete path to the user's home directory.
For example, if your username is “JRandom” then your home drive and path is probably one of the following:
C:\Users\JRandom (Windows 7 and newer) C:\Documents and Settings\JRandom (XP and older)
| Variable | Possible value | registry | |
|---|---|---|---|
| HOMEDRIVE | C: | The combination of HOMEDRIVE and HOMEPATH points to a location where personal files should be stored. It might, but needs not to, be the same directory as %USERPROFILE% | HKCU\Volatile Environment |
| HOMEPATH | \Users\Rene | Rene correpsonds to %USERNAME%. Compare with %USERPROFILE% | HKCU\Volatile Environment |
PowerShell : About Automatic Variables
Another Microsoft article that mentions these variables:
0$HOME
Contains the full path of the user's home directory. This variable is the equivalent of the "$env:homedrive$env:homepath" Windows environment variables, typically C:\Users<UserName>.