Sets a standard input file before starting a process.
Setting an input file is sometimes necessary (undocumented Windows requirement) when redirecting output, for example xcopy.
kernel.bdh
ProcessSetStdInFile( in hProcess : number, in sStdInFileName : string ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hProcess | The handle which identifies the process. The handle is returned by ProcessInitialize. |
sStdInFileName | Name of the input file. |
transaction TmyTrans1 var iProcess : number; iStatus : number; begin iProcess := ProcessInitialize("cmd", PROCESS_ATTACHED, "/C xcopy \\bin\\debug \\temp /y", "T:\\bin\\release", "T:\\temp\\xcopyout.log", "T:\\temp\\xcopyerr.log"); ProcessSetStdInFile(iProcess,"T:\\temp\\xcopyin.log"); ProcessStart(iProcess); iStatus := PROCESS_STATE_EXECUTING; while (iStatus = PROCESS_STATE_EXECUTING) do wait 1.0; iStatus := ProcessGetState(iProcess); end; ProcessFree(iProcess); end TmyTrans1;