VB:
Public Function GetWinDir() as String
'Create a directory info structure of C:\Win2k\System32 or C:\Windows\system, etc.
Dim di as New DirectoryInfo(Environment.SystemDirectory)
'Return the full path of its parent
Return di.Parent.FullName
End Function
C#:
public String GetWinDir()
{
//Create a directory info structure of C:\Win2k\System32 or C:\Windows\system, etc.
DirectoryInfo di = new DirectoryInfo(Environment.SystemDirectory)
// Return the full path of its parent
return di.Parent.FullName
}