The so-called Windows System directory shorthand environment variable is a relatively simple abbreviation for some common and fixed Windows directory paths, making it easier to enter or locate.
Windows system is installed by default in the computer C disk in the Windows directory, but this is not fixed, if your system is not installed in this directory, then the program to locate your system directory, you need to use the directory shorthand environment variables. Using these environment variables, the programmer or system administrator can easily find the system directory path that you want to use without prior knowledge of your system installation location.
Next, I'll show you some common Windows system directory shorthand environment variables:
%systemdrive%
This represents the disk partition on which the Windows system resides, which is the Fugen directory of disks installed by the Windows system, usually the root of the C disk.
%homedrive%
This is the same as the function of the%systemdrive% described above.
%SYSTEMROOT%
It points to the directory where the Windows system is located, usually c:windows.
%WINDIR%
Same as%systemroot%, pointing to the directory where Windows resides.
%ProgramFiles%
The path to program files is usually c:program files.
%commonprogramfiles%
Points to the Common Files (Common files) directory, usually c:program FilesCommon files.
%USERPROFILE%
A user directory that points to the current account, usually the current user name c:documents and settings.
%homepath%
The function is the same as the%userprofile% above.
%allusersprofile%
A user directory that points to all users, usually c:documents and settingsall users.
%appdata%
Refers to the current user's application Data directory, usually c:documents and settings current username application data.
Many articles will introduce a variable called%allappdata% that points to c:documents and Settingsall usersapplication data, but this variable is not available.
%TEMP%
It points to the current user's temporary file directory, usually the c:documents and settings current user name, local settingstemp.
%TMP%
Is the same as the%temp% point.
%comspec%
Point to C:windowssystem32cmd.exe, which is the command prompt.