Hi all,

I am writing a program in VB6 where I need to determine the path for the system32 folder.
I know the default path is c:\WINDOWS\Sytem32, but some people installed they windows in another drive.
How i can get the path of system32 folder?

Best Regards
Vega

You mean system directory?

See if this helps :

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
    Dim sSave As String, Ret As Long
    sSave = Space(255)
    Ret = GetSystemDirectory(sSave, 255)
    sSave = Left$(sSave, Ret)
    MsgBox "Windows System directory: " + sSave
End Sub
commented: Perfect +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.