hi, does anyone know how to get the root directry in windows, for eg: my root dir is C:\windows\
but this can change, there can be instances when the root is d:\windows or D:\windows.000\ or E:\windows, how can i determine this through VB?
thanx
Printable View
hi, does anyone know how to get the root directry in windows, for eg: my root dir is C:\windows\
but this can change, there can be instances when the root is d:\windows or D:\windows.000\ or E:\windows, how can i determine this through VB?
thanx
The following code will return the Windows directory:
Declare Function GetWindowsDirectory Lib "Kernel32" Alias "GetWindowsDirectoryA" (ByVal strWinDir As String, ByVal dblListLen As Long) As Long
strWinDir = String$(255, Chr$(0))
lngListLen = GetWindowsDirectory(strWinDir, Len(strWinDir))
strWinDir = Left$(strWinDir, lngListLen)
If Right$(strWinDir, 1) <> "\" Then strWinDir = strWinDir + "\"
thanx a trill