[DllImport("shell32.dll")]
static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken,
uint dwFlags, [Out] StringBuilder pszPath);
<DllImport("shell32.dll")> _
Private Shared Function SHGetFolderPath(ByVal hwndOwner As IntPtr, ByVal nFolder As Int32, ByVal hToken As IntPtr, ByVal dwFlags As Int32, ByVal pszPath As StringBuilder) As Int32
End Function
Private Const CSIDL_WINDOWS As Integer = &H24
Dim winPath As New StringBuilder(300)
If SHGetFolderPath(Nothing, CSIDL_WINDOWS, Nothing, 0, winPath) <> 0 Then
Throw New ApplicationException("Can't get window's directory")
End If
Console.WriteLine(winPath.ToString)
Do you know one? Please contribute it!