Private Declare Function GetSystemDirectory Lib "kernel32" Alias _ "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize _ As Long) As Long ' *************************************** ' Legge la directory di Windows\System '***************************************** Public Function GetSysDir() As String Dim lpBuffer As String * 255 Dim Length As Long Length = GetSystemDirectory(lpBuffer, Len(lpBuffer)) GetSysDir = Left$(lpBuffer, Length) End Function Private Sub Command2_Click() MsgBox GetSysDir ' ottieni c:\windows\System32 End Sub |