Передача строки с числом ссылок (Reference Count) -1:
const cMyExe = 'foo.exe' var sMyExe: string; begin sMyExe := cMyExe; CreateProcess(nil, PChar(sMyExe), nil, nil, False, 0, nil, nil, StartupInfo, ProcessInfo); end;
const cMyExe = 'foo.exe' var sMyExe: string; begin sMyExe := cMyExe; CreateProcess(nil, PChar(sMyExe), nil, nil, False, 0, nil, nil, StartupInfo, ProcessInfo); end;