|
-
Nov 30th, 2001, 11:01 PM
#1
Thread Starter
Hyperactive Member
Finding root in windows through VB
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
-
Nov 30th, 2001, 11:05 PM
#2
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 30th, 2001, 11:08 PM
#3
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 + "\"
-
Nov 30th, 2001, 11:19 PM
#4
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|