Expands environment variables into text, i.e.
SystemRoot, or
ProgramFiles
Syntax
| Visual Basic (Declaration) | |
|---|
Public Shared Function ExpandEnvironment( _
ByVal input As String _
) As String |
Parameters
- input
Example
Library/Library.Test/TestFileUtils.cs
| C# | Copy Code |
|---|
Assert.AreEqual(
Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Test")),
Path.GetFullPath(FileUtils.ExpandEnvironment(@"PROGRAMFILES\Test"))
); |
| VB.NET | Copy Code |
|---|
Assert.AreEqual(Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Test")), Path.GetFullPath(FileUtils.ExpandEnvironment("PROGRAMFILES\Test"))) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also