4

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.

1
  • @StevenPenny Here - libertyboy.free.fr/computing/reference/envariables - HomeDrive is described as the drive letter assigned to the volume which contains your user profiles and SystemDrive as the drive letter of the volume where Windows is installed. So as I understand, the values of these variables are different only if you somehow installed your User profile on the different drive than the operating system itself.
    – john c. j.
    Jan 30, 2021 at 19:13

2 Answers 2

7

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.

3
  • @johnc.j. Try the google "site:microsoft.com" parameter, it literally seems to search MIcrosoft's site better than their internal Search bar and Bing. The first two results are enlightening on MS Environment Variables. Dec 23, 2017 at 0:38
  • "in an (Active Directory) Domain, it would reside on a server." It may be better to say could reside on a server as this is not the default behavior in an AD domain but instead requires specific configuration. Dec 23, 2017 at 2:06
  • I've done a search on Google for site:microsoft.com HOMEDRIVE as per the link in this post, and there isn't actually much information on it and its definition. Unlike SYSTEMDRIVE, which is pretty well documented.
    – AJM
    Oct 24 at 12:57
4
+50

In answer to @StevenPenny asking for sourced answers: There are surprisingly few such, and almost none from Microsoft. Below are a few sources.

Upgrade to Windows versions that is before Windows 10 is blocked if Users and ProgramData directories are changed

One of the few sources by Microsoft:

%systemdrive% is defined as the drive that contains the Windows directory.

HOMEPATH

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)

Windows environment variables

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:

$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>.

1
  • 1
    The content of the "PowerShell: About Automatic Variables" article has had at least one significant change since this was posted - it now states: ''Windows can redirect the location of the user's profile. This means that $HOME may not have the same value as "$env:HOMEDRIVE$env:HOMEPATH".''
    – AJM
    Oct 24 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .