Environment.ExpandEnvironmentVariables Method replaces the name of each environment variable embedded in string
Imports System
Class Sample
Public Shared Sub Main()
Dim str As [String]
Dim nl As [String] = Environment.NewLine
Dim query As [String] = "%SystemDrive% and %SystemRoot%"
str = Environment.ExpandEnvironmentVariables(query)
Console.WriteLine("ExpandEnvironmentVariables: {0} {1}", nl, str)
End Sub 'Main
End Class 'Sample