|
使用API来做.
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Dim WindowsDirectory As String, SystemDirectory As String, x As Long
WindowsDirectory = Space(255)
SystemDirectory = Space(255)
x = GetWindowsDirectory(WindowsDirectory, 255)
x = GetSystemDirectory(SystemDirectory, 255)
MsgBox "Windows的安装目录是:" + WindowsDirectory+",系统目录是:" + SystemDirectory
|
|