Giter VIP home page Giter VIP logo

environmentvariablecheatsheet's Introduction

Windows Environment Variable Cheatsheet

A list of some useful environment variables in Windows.

Variables should be enclosed in %, for example echo %TEMP% on my Windows 10 machine will result in the output C:\Users\{username}\AppData\Local\Temp, obviously replace {username} with your login username. In most cases the case doesn't matter, but for consistancy we's show variables in upper case.

Variable Default/Information
USERNAME your user name
USERDOMAIN The domain or machine name
COMPUTERNAME The machine name
NUMBER_OF_PROCESSORS The number of processors running on the machine
DATE The current date
TIME The current time in TIME format
RANDOM A random number from 0 to 32767
OS The operating system (Win10 still reports Windows_NT)
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC, comma separated exectuable file extensions in order of precedence (left to right)
PROCESSOR_ARCHITECTURE AMD64/IA64/x86 the architecture of the current process
PROCESSOR_IDENTIFIER Processor ID
PROCESSOR_LEVEL Processor level
PROCESSOR_REVISION Processor revision
PROMPT The command prompt format (for example $P$G)
ERRORLEVEL The error value set when a program exits
COMSPEC C:\Windows\System32\cmd.exe
LOGONSERVER \{domain}
USERDOMAIN_ROAMINGPROFILE User domain associated with romaing profile

The following are the default directory locations

Variable Directory location
SYSTEMDRIVE C: (or whatever your system drive is)
CD The current directory
TMP or TEMP C:\Users\{username}\AppData\Local\Temp
HOMEDRIVE C:
HOMEPATH \Users\{username}
USERPROFILE C:\Users\{username}
APPDATA C:\Users\{username}\AppData\Roaming
ALLUSERSPROFILE C:\ProgramData
PROGRAMFILES C:\Program Files
PROGRAMFILES(x86) C:\Program Files (x86)
COMMONPROGRAMFILES C:\Program Files\Common Files
COMMONPROGRAMFILES(x86) C:\Program Files (x86)\Common Files
PROGRAMDATA C:\ProgramData
LOCALAPPDATA C:\Users\{username}\AppData\Local
SYSTEMROOT or WINDIR C:\windows (Note: WINDIR may be altered so user SYSTEMROOT instead)
PUBLIC C:\Users\Public
PATH Your file search path
PSMODULEPATH C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Module
ONEDRIVE C:\Users\{username}\OneDrive
DRIVERDATA C:\Windows\System32\Drivers\DriverData
CMDCMDLINE Command line used to launch CMD (i.e. "C:\windows\system32\cmd.exe")
CMDEXTVERSION Number of command process extensons for CMD prompt

Common directory locations (including the %)

Variable Directory location
%USERPROFILE%\Desktop C:\Users\{username}\Desktop
%USERPROFILE%\Downloads C:\Users\{username}\Downloads
%USERPROFILE%\Documents C:\Users\{username}\Documents
%USERPROFILE%\Pictures C:\Users\{username}\Pictures
%USERPROFILE%\Music C:\Users\{username}\Music
%USERPROFILE%\Videos C:\Users\{username}\Videos
%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs C:\ProgramData\Microsoft\Windows\Start Menu\Programs
%APPDATA%\Microsoft\Windows\Start Menu\Programs C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Some default application directories

Variable Description
%USERPROFILE%\.npmrc NPM ini-formatted configuration file
%USERPROFILE%\.gitconfig Global Git configuration file
%USERPROFILE%\.bash_history History of BASH commands
%APPDATA%\cabal Cabal configuration and packages
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates Visual Studio user's project templates
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates Visual Studio user's item templates
%USERPROFILE%\.nuget\packages Nuget packages folder

environmentvariablecheatsheet's People

Contributors

putridparrot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.