Common Windows System directory shorthand environment variables

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.