James Posted February 1, 2010 Share Posted February 1, 2010 (edited) 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 If anyone wants to add variables for Windows Vista, Seven then please do!Thanks,JamesEdit: Completely forgot to write the variable for %WINDIR% Edited February 1, 2010 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
James Posted February 1, 2010 Author Share Posted February 1, 2010 I guess this would be because they rely on commands to have commands sent to CMD already. Although RANDOM, TIME and DATE should work without them really Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
MvGulik Posted February 1, 2010 Share Posted February 1, 2010 (edited) whatever Edited February 7, 2011 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 ... Link to comment Share on other sites More sharing options...
bolthead Posted February 2, 2010 Share Posted February 2, 2010 For a list of Environment Variables available on a particular machine try this. #include <Constants.au3> Local $PID = Run(@ComSpec & " /c set", @SystemDir, @SW_HIDE, $STDOUT_CHILD) Local $line While 1 $line &= StdoutRead($PID) If @error Then ExitLoop Wend ConsoleWrite($Line) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now