Hyper Expert /Blog
About
Archives

Windows Environment Variables

Every time I write a new script or do a new Group Policy at work, I search for this, I thought it would be better to document it here so I wont have to keep on searching for it 😉

%ALLUSERSPROFILE%
Default for Windows XP: C:\Documents and Settings\All Users
Default for Windows 7/8/2008: C:\ProgramData

%APPDATA%
Default for Windows XP: C:\Documents and Settings\{username}\Application Data
Default for Windows 7/8/2008: C:\Users\{username}\AppData\Roaming

%ALLUSERSPROFILE%
Default for Windows XP: C:\Program Files\Common Files
Default for Windows 7/8/2008: C:\Program Files\Common Files

%ALLUSERSPROFILE%
Default for Windows XP: C:\Program Files (x86)\Common Files
Default for Windows 7/8/2008: C:\Program Files (x86)\Common Files

%ALLUSERSPROFILE%
Default for Windows XP: {computername}
Default for Windows 7/8/2008: {computername}

%COMSPEC%
Default for Windows XP: C:\Windows\System32\cmd.exe
Default for Windows 7/8/2008: C:\Windows\System32\cmd.exe

%HOMEDRIVE%
Default for Windows XP: C:
Default for Windows 7/8/2008: C:

%HOMEPATH%
Default for Windows XP: \Documents and Settings\{username}
Default for Windows 7/8/2008: \Users\{username}

%LOCALAPPDATA%
Default for Windows XP: N/A
Default for Windows 7/8/2008: C:\Users\{username}\AppData\Local

%LOGONSERVER%
Default for Windows XP: \\{domain_logon_server}
Default for Windows 7/8/2008: \\{domain_logon_server}

%PATH%
Default for Windows XP: C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;{plus program paths}
Default for Windows 7/8/2008: C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;{plus program paths}

%PATHEXT%
Default for Windows XP: .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH;
Default for Windows 7/8/2008: .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC

%ProgramData%
Default for Windows XP: N/A
Default for Windows 7/8/2008: C:\ProgramData

%ProgramFiles%
Default for Windows XP: C:\Program Files
Default for Windows 7/8/2008: C:\Program Files

%ProgramFiles(x86)% Only for 64bit systems
Default for Windows XP: C:\Program Files (x86)
Default for Windows 7/8/2008: C:\Program Files (x86)

%PROMPT%
Default for Windows XP: C:>
Default for Windows 7/8/2008: C:>

%PSModulePath%
Default for Windows XP: N/A
Default for Windows 7/8/2008: %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\

%Public%
Default for Windows XP: N/A
Default for Windows 7/8/2008: C:\Users\Public

%SYSTEMDRIVE%
Default for Windows XP: C:
Default for Windows 7/8/2008: C:

%SYSTEMROOT%
Default for Windows XP: C:\Windows
Default for Windows 7/8/2008: C:\Windows

%TEMP% and %TMP%
Default for Windows XP: C:\Documents and Settings\{username}\Local Settings\Temp
Default for Windows 7/8/2008: C:\Users\{Username}\AppData\Local\Temp

%USERDOMAIN%
Default for Windows XP: {userdomain}
Default for Windows 7/8/2008: {userdomain}

%USERNAME%
Default for Windows XP: {username}
Default for Windows 7/8/2008: {username}

%USERPROFILE%
Default for Windows XP: %SystemDrive%\Documents and Settings\{username}
Default for Windows 7/8/2008: %SystemDrive%\Users\{username}

%WINDIR%
Default for Windows XP: C:\Windows
Default for Windows 7/8/2008: C:\Windows

///

Hi, my name is Ali. I am a Systems Engineer. I live in the beautiful Evergreen state. I have a Bachelor degree of science in Information Technology with a handful of accompanying I.T. certificates. I also have a degree in Computer Networking. I am an Apple Certified Technician, Microsoft MCITP and a Linux expert.

1 Comment

  1. GPO Windows Environment Variables | stevenwatsonuk · August 22, 2016

    […] August 22, 2016stevenwatsonuk Windows Environment Variables […]

    Reply

Would you like to share your thoughts?