用API获取的Ini文件必须去除"\0"才行。
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Dim s As String * 256
dim compilerPath As String
GetPrivateProfileString "IniSection", "Key", "", s, 256, "IniFilePath"
For i = 1 To Len(s)
If Asc(Mid(s, i, 1)) <> 0 Then
compilerPath = compilerPath + Mid(s, i, 1)
Else
Exit For
End If
Next
MsgBox compilerPath & "\MyExeFile.exe"