Jump to content
Sign in to follow this  

Windows Environment Variables

Recommended Posts


Here is a list of all Windows XP (at least) environment variables and a small description of each. Some of these variables are already contained in macros/functions but it's always nice to have another method of doing things.

ConsoleWrite("All Users Profile location: " & EnvGet("ALLUSERSPROFILE") & @CRLF)
ConsoleWrite("Application Data: " & EnvGet("APPDATA") & @CRLF)
ConsoleWrite("Current Directory: " & EnvGet("CD") & @CRLF)
ConsoleWrite("Exact string to start CMD: " & EnvGet("CMDCMDLINE") & @CRLF)
ConsoleWrite("Version number of current Command Processor Extensions: " & EnvGet("CMDEXTVERSION") & @CRLF)
ConsoleWrite("Exact path to command shell executable: " & EnvGet("COMSPEC") & @CRLF)
ConsoleWrite("Current date (via CMD): " & EnvGet("DATE") & @CRLF)
ConsoleWrite("Most recent error code: " & EnvGet("ERRORLEVEL") & @CRLF)
ConsoleWrite("Home drive location: " & EnvGet("HOMEDRIVE") & @CRLF)
ConsoleWrite("Users full path: " & EnvGet("HOMEPATH") & @CRLF)
ConsoleWrite("Network path: " & EnvGet("HOMESHARE") & @CRLF)
ConsoleWrite("Logon server: " & EnvGet("LOGONSERVER") & @CRLF)
ConsoleWrite("Number of CPUs: " & EnvGet("NUMBER_OF_PROCESSORS") & @CRLF)
ConsoleWrite("Operating system name: " & EnvGet("OS") & @CRLF)
ConsoleWrite("Search path for executable files: " & EnvGet("PATH") & @CRLF)
ConsoleWrite("File extensions that OS deems to be an executable: " & EnvGet("PATHEXT") & @CRLF)
ConsoleWrite("CPU Architecture: " & EnvGet("PROCESSOR_ARCHITECTURE") & @CRLF)
ConsoleWrite("CPU Identifier: " & EnvGet("PROCESSOR_IDENTIFIER") & @CRLF)
ConsoleWrite("CPU Level: " & EnvGet("PROCESSOR_LEVEL") & @CRLF)
ConsoleWrite("CPU Revision: " & EnvGet("PROCESSOR_REVISION") & @CRLF)
ConsoleWrite("Command prompt settings: " & EnvGet("PROMPT") & @CRLF)
ConsoleWrite("Generate a random number between 0 and 32767: " & EnvGet("RANDOM") & @CRLF)
ConsoleWrite("Drive containing the Windows root directory: " & EnvGet("SYSTEMDRIVE") & @CRLF)
ConsoleWrite("Location of Windows directory: " & EnvGet("SYSTEMROOT") & @CRLF)
ConsoleWrite("Location of the temp directory: " & EnvGet("TEMP") & @CRLF)
ConsoleWrite("The current system time: " & EnvGet("TIME") & @CRLF)
ConsoleWrite("Domain that contains the users account: " & EnvGet("USERDOMAIN") & @CRLF)
ConsoleWrite("Name of the currently logged on user: " & EnvGet("USERNAME") & @CRLF)
ConsoleWrite("Location of the profile of the current user: " & EnvGet("USERPROFILE") & @CRLF)
ConsoleWrite("Locations of the OS directory: " & EnvGet("WINDIR") & @CRLF)

I've just typed this all ouut while at college, so... I can't guarentee that I spelt everything right, no AutoIt for me here to automate for me Posted Image

If anyone wants to add variables for Windows Vista, Seven then please do!



Edit: Completely forgot to write the variable for %WINDIR% Posted Image

Edited by JamesBrooks

Share this post

Link to post
Share on other sites
whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this