book
  • README
  • cheatsheet
    • bash
      • builtin
      • syntactic sugar
      • cmd
      • havefun
    • text-processing
      • awk
      • sed
      • html
      • json
      • regex
      • unicode
    • osx
    • curl
    • tricky
    • widget
    • proxy
    • colors
    • math
    • media
    • ssl
      • keystore
      • verification
      • server
      • client
      • tricky
    • windows
      • powershell
      • choco
      • wsl
      • wt
      • shortcut
      • clsid
      • env
      • shell:folder
  • vim
    • nvim
    • install
    • color
    • plugins
      • usage
      • other plugins
      • deprecated
    • tricky
    • viml
    • windows
    • troubleshooting
  • devops
    • admin tools
    • ssh
    • git
      • config
      • alias
      • submodule
      • eol
      • example
      • gerrit
        • gerrit API
      • github
      • troubleshooting
      • tricky
      • statistics
    • pre-commit
    • release-tools
    • tmux
      • cheatsheet
    • ansible
    • vault
    • artifactory
      • api
      • cli
      • aql
      • nginx cert
    • klocwork
      • kwadmin
      • kwserver
      • api
      • q&a
    • elk
    • mongodb
    • android
    • mobile
  • jenkins
    • config
      • windows
    • appearance
    • troubleshooting
    • jenkinsfile
      • utility
      • parallel
      • build
      • envvar
      • properties
      • trigger
      • node
    • script
      • job
      • build
      • stage
      • agent
      • security & authorization
      • exception
      • monitor
      • tricky
    • api
      • blueocean
    • cli
    • plugins
      • kubernetes
      • docker
      • shared-libs
      • lockable-resource
      • ansicolor
      • badge
      • groovy-postbuild
      • simple-theme
      • customizable-header
      • artifactory
      • jira-steps
      • job-dsl
      • build-timeline
      • crumbIssuer
      • coverage
      • uno-choice
      • tricky
  • virtualization
    • kubernetes
      • init
        • kubespray
        • kubeadm
          • environment
          • crio v1.30.4
          • docker v1.15.3
          • HA
        • addons
        • etcd
      • kubectl
        • pod
        • deploy
        • replicasets
        • namespace
        • secrets
      • node
      • certificates
      • events
      • kubeconfig
      • kubelet
      • troubleshooting
      • cheatsheet
      • auth
      • api
      • tools
        • monitor
        • helm
        • network
        • minikube
    • docker
      • run & exec
      • voume
      • remove
      • show info
      • dockerfile
      • dockerd
      • tricky
      • troubleshooting
      • windows
    • crio
    • podman
  • ai
    • prompt
  • osx
    • apps
      • init
      • brew
    • defaults
    • system
    • network
    • script
    • tricky
  • linux
    • devenv
    • util
      • time & date
      • output formatting
      • params
      • tricky
    • nutshell
    • disk
    • network
    • troubleshooting
    • system
      • apt/yum/snap
      • authorization
      • apps
      • x11
    • ubuntu
      • systemctl
      • x
    • rpi
  • programming
    • groovy
    • python
      • config
      • basic
      • list
      • pip
      • q&a
    • others
    • archive
      • angular
      • maven
      • mysql
        • installation
        • logs
      • ruby
        • rubyInstallationQ&A
  • tools
    • fonts
    • html & css
    • Jira & Confluence
    • node & npm
      • gitbook
      • hexo
      • github.page
      • code themes
    • app
      • microsoft office
      • vscode
      • virtualbox
      • iterm2
      • browser
      • skype
      • teamviewer
      • others
  • quotes
  • english
Powered by GitBook
On this page

Was this helpful?

  1. cheatsheet
  2. windows

env

PreviousclsidNextshell:folder

Last updated 1 year ago

Was this helpful?

default

Variable
Default value assuming the system drive is C:

ALLUSERSPROFILE

C:\ProgramData

APPDATA

C:\Users\{username}\AppData\Roaming

ClientName

Terminal servers only - the ComputerName of a remote host.

CMDEXTVERSION

The current Command Processor Extensions version number. (NT = "1", Win2000+ = "2".)

CMDCMDLINE

The original command line that invoked the Command Processor.

CommonProgramFiles

C:\Program Files\Common Files

COMMONPROGRAMFILES(x86)

C:\Program Files (x86)\Common Files

COMPUTERNAME

{computername}

COMSPEC

C:\Windows\System32\cmd.exe or if running a 32 bit WOW - C:\Windows\SysWOW64\cmd.exe

ERRORLEVEL

The current ERRORLEVEL value, automatically set when a program exits.

HOMEDRIVE

C:

HOMEPATH

C:\Users\{username}

LOCALAPPDATA

C:\Users\{username}\AppData\Local

LOGONSERVER

\\{domain_logon_server}

NUMBER_OF_PROCESSORS

The Number of processors running on the machine.

OS

Operating system on the user's workstation.

System

C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;{plus program paths}

ProgramData

C:\ProgramData

ProgramFiles

C:\Program Files or C:\Program Files (x86)

ProgramFiles(x86) 1

C:\Program Files (x86) (but only available when running under a 64 bit OS)

RANDOM

A random integer number, anything from 0 to 32,767 (inclusive).

%SessionName%

Terminal servers only - for a terminal server session, SessionName is a combination of the connection name, followed by #SessionNumber. For a console session, SessionName returns "Console".

SYSTEMDRIVE

C:

SYSTEMROOT

By default, Windows is installed to C:\Windows but there's no guarantee of that, Windows can be installed to a different folder, or a different drive letter.

TEMP and TMP

C:\Users\{Username}\AppData\Local\Temp; Under XP this was C:\{username}\Local Settings\Temp

TIME

The current time using same format as TIME.

USERPROFILE

%SystemDrive%\Users{username}. This is equivalent to the $HOME environment variable in Unix/Linux

WINDIR

%windir% is a regular User variable and can be changed, which makes it less robust than %SystemRoot%; Set by default as windir=%SystemRoot%

Windows Environment Variables List
default Windows Environment Variables List