Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Public Sub GetSysFolders(WinSysPath As String, WinPath As String) cValue = Space(260) eValue = GetSystemDirectory(cValue, Len(cValue)) 'get the path WinSysPath = Left(cValue, eValue) 'parse the path into the global string
iValue = GetWindowsDirectory(cValue, Len(cValue)) 'get the path WinPath = Left(cValue, iValue) 'parse the path to the global string
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Sub GetSysFolders(WinSysPath As String, WinPath As String) cValue = Space(260)
eValue = GetSystemDirectory(cValue, Len(cValue)) 'get the path
WinSysPath = Left(cValue, eValue) 'parse the path into the global string
iValue = GetWindowsDirectory(cValue, Len(cValue)) 'get the path
WinPath = Left(cValue, iValue) 'parse the path to the global string
End Sub
这个我试过,但是不可以,它默认的是找大写的System,我还是无法取得\WINNT\system32