I'm having difficulties trying to execute a dos batch file. The
function I'm using to run it is
function ExecuteApplication(PPath, PFileName, PParameters : String):
Boolean;
var LStartUp: TStartupInfo;
LProcess: TProcessInformation;
begin
Result := True;
try
FillChar(LStartUp, SizeOf(LStartUp), 0); // Crude, I
know
LStartUp.cb := SizeOf(LStartUp);
Win32Check (
CreateProcess (
PChar(PFileName)
, PChar(PFileName + ' ' + PParameters)
, nil
, nil
, True
, 0, nil
, PChar(PPath)
, lStartUp
, lProcess
)
);
CloseHandle(LProcess.HThread);
WaitForSingleObject(LProcess.HProcess, INFINITE);
CloseHandle(LProcess.HProcess);
except
Result := False;
end;
end;
This was working fine until I changed the last parameter in my parameter
string to be a bit longer (from "/Cubeview" (including quotes) to
"/General Library - Delphi 4/Cubeview"). It's still only about 100
chars. Now it doesn't run the batch file at all - it just pops up a DOS
window with a command prompt, and waits for you to type something in!
Not even "echo hello" gets run. What did I do wrong?!
Cheers,
Carl Reynolds Ph: +64-9-4154790
CJN Technologies Ltd. Fax: +64-9-4154791
[EMAIL PROTECTED] DDI: +64-9-4154795
PO Box 302-278, North Harbour, Auckland, New Zealand
12 Piermark Drive, North Harbour Estate, Auckland, NZ
Visit our website at http://www.cjntech.co.nz/
application/ms-tnef