J JezB Aug 17, 2004 #1 There is no enumeration for the windows directory in SpecialDirectories, how can I get the windows directory path ?
There is no enumeration for the windows directory in SpecialDirectories, how can I get the windows directory path ?
J Jared Aug 17, 2004 #2 Depending on which directory you want... Dim WinDir As String = Environment.GetFolderPath(Environment.SpecialFolder.System) WinDir += vbCrLf & Environment.ExpandEnvironmentVariables("%SYSTEMROOT%") MsgBox(WinDir)
Depending on which directory you want... Dim WinDir As String = Environment.GetFolderPath(Environment.SpecialFolder.System) WinDir += vbCrLf & Environment.ExpandEnvironmentVariables("%SYSTEMROOT%") MsgBox(WinDir)
H Herfried K. Wagner [MVP] Aug 17, 2004 #4 * "JezB said: There is no enumeration for the windows directory in SpecialDirectories, how can I get the windows directory path ? Click to expand... System directory: 'Environment.GetFolderPath(Environment.SpecialFolder.System))' Windows directory: 'System.Environment.ExpandEnvironmentVariables("%WinDir%")' - or - Trick by Bill McCarthy: 'System.Environment.GetFolderPath(CType(&H24, System.Environment.SpecialFolder))' - or - P/invoke on 'GetWindowsDirectory' (IMO the preferred way): <URL:http://groups.google.de/groups?selm=#pJhic2CBHA.2200@tkmsftngp07>
* "JezB said: There is no enumeration for the windows directory in SpecialDirectories, how can I get the windows directory path ? Click to expand... System directory: 'Environment.GetFolderPath(Environment.SpecialFolder.System))' Windows directory: 'System.Environment.ExpandEnvironmentVariables("%WinDir%")' - or - Trick by Bill McCarthy: 'System.Environment.GetFolderPath(CType(&H24, System.Environment.SpecialFolder))' - or - P/invoke on 'GetWindowsDirectory' (IMO the preferred way): <URL:http://groups.google.de/groups?selm=#pJhic2CBHA.2200@tkmsftngp07>