The Environment class provides functions for retrieving information about the local machine



 EnvironmentVariableTarget Used to indicate the source or destination of the environment variables when read from or written to the system.  
 SpecialFolder This enum represents a list of folders accessible using GetFolderPath. These definitions are from the Microsoft Dot NET 1.1 MSDN Library.  


 CommandLine (get) Returns the command specified when executing the current application, including any arguments typed after the application name.  
 CurrentDirectory (get) Returns the current directy of the executing application.  
 CurrentDirectory (let) Sets the current directory for the executing application.  
 Is64BitOperatingSystem (get) Determines whether the current operating system is a 64-bit operating system.  
 MachineName (get) Returns the name of the local computer.  
 NewLine (get) Returns string of a newline character for the local computer.  
 OSVersion (get) Returns an object representing the current operating system.  
 ProcessorCount (get) Returns the number of processors on the current machine.  
 SystemDirectory (get) Returns the System directory for the current OS.  
 TickCount (get) Returns the number of milliseconds the system has been running since it started.  
 UserDomainName (get) Returns the name of the local machine within a domain  
 UserInteractive (get) Determines if the current application is allowed to have user interaction.  
 UserName (get) Returns the name of the currently logged in user of the local computer.  
 WorkingSet (get) Returns the amount of physical memory the current application is allocated.  


 ExpandEnvironmentVariables Replaces environment tags within a string with the actual values.  
 GetCommandLineArgs Returns an array of parsed Arguments from the command line.  
 GetEnvironmentVariable Returns an environment variable value.  
 GetEnvironmentVariables Returns an IDictionary object containing all environment variables as name/value pairs.  
 GetFolderPath Returns the path for a specified folder type.  
 GetLogicalDrives Returns the logical drives installed on the local machine.  
 ParseCommandLineArgs Provides a mechanism to parse arguments from a command line string.  
 SetEnvironmentVariable Sets, creates, or deletes an environment variable in the specified region.  


This class cannot be directly instantiated. In order to access the methods, use the class name directly.

 Debug.Print Environment.MachineName
 Debug.Print Environment.UserName

See Also

Project CorLib Overview

Class Environment Overview