Environment.CurrentDirectory Property gets or sets the fully qualified path of the current working directory. : Environment « Development « VB.Net






Environment.CurrentDirectory Property gets or sets the fully qualified path of the current working directory.

 

Imports System
Imports System.IO
Imports System.Collections

Class Sample
   Public Shared Sub Main()
        ' Change the directory to %WINDIR%              
        Environment.CurrentDirectory = Environment.GetEnvironmentVariable("windir")
        Dim info As New DirectoryInfo(".")
        Console.WriteLine(("Directory Info:   " + info.FullName))        

   End Sub
End Class

   
  








Related examples in the same category

1.Environment Class provides information about current environment and platform
2.Sample for Environment class summary
3.Get Environment variables
4.Environment.Exit Method terminates this process and gives the underlying operating system the specified exit code.
5.Environment.ExitCode Property gets or sets the exit code of the process.
6.Environment.ExpandEnvironmentVariables Method replaces the name of each environment variable embedded in string
7.Environment.FailFast immediately terminates a process after writing a message to the Windows Application event log
8.Environment.GetCommandLineArgs returns a string array containing the command-line arguments for the current process.
9.Environment.GetEnvironmentVariables Method retrieves all environment variable names and their values
10.Environment.GetFolderPath (Environment.SpecialFolder)
11.Environment.GetLogicalDrives returns the logical drives on the current computer.
12.Environment.MachineName Property gets the NetBIOS name of this local computer.
13.Environment.NewLine Property gets the newline string defined for this environment.
14.Environment.OSVersion Property gets platform identifier and version number.
15.Environment.ProcessorCount Property gets the number of processors on the current machine.
16.Environment.StackTrace Property gets current stack trace information.
17.Environment.SystemDirectory Property gets the fully qualified path of the system directory.
18.Environment.TickCount Property gets the number of milliseconds elapsed since the system started.
19.Environment.UserDomainName Property gets the network domain name associated with the current user.
20.Environment.UserInteractive Property tells whether the current process is running in user interactive mode.
21.Environment.UserName Property gets the user name of the person who is currently logged on to the Windows operating system.
22.Environment.Version Property describes the major, minor, build, and revision numbers of the common language runtime.
23.Environment.WorkingSet Property gets the amount of physical memory mapped to the process context.
24.Get the common language runtime version.