CreateProcess 失败!%1 不是有效的 Win32 应用程序。莫名其妙啊
FillChar(StartupInfo,SizeOf(StartupInfo),0); StartupInfo.cb := SizeOf(StartupInfo); FillChar(ClRunInf,SizeOf(ClRunInf),0); sAppFileName := '"E:\中文\中文.exe"'; sCommandLine := sAppFileName + ' ' + (sParam1) + ' ' + sParam2; //听说 lpCommandLine 会被写... Move(sCommandLine[1],szCommandLine, Length(sCommandLine)); szCommandLine[Length(sCommandLine) + 1] := #0; if CreateProcess(nil,//PChar(sAppFileName), //lpApplicationName, @szCommandLine, //lpCommandLine, "E:\中文\中文.exe" sParam1 sParam2 //双引号 加不加好象都一样 nil, //lpProcessAttributes, nil, //lpThreadAttributes, False, //bInheritHandles, 0,//Create_SUSPENDED, //dwCreationFlags,Create_SUSPENDED nil, //lpEnvironment, PChar(sMirPath), //lpCurrentDirectory, StartupInfo, //lpStartupInfo, ClRunInf)then begin //lpProcessInformation //Result:=GetLastError(); end else begin //直接双击 E:\中文\中文.exe 是可以跑的 //在有些的机器上跑不起来 本机能跑 OutMsg('失败 2:' + SysErrorMessage(GetLastError));//%1 不是有效的 Win32 应用程序。 end;