
Nothing happened - CreateProcess()
Quote:
> When i use this procedure to call DOS command. Nothing happen!
> Please can anybode help me? Where i made the mistake?
> thanks in advance,
> Tomas Volsicky
> BOOL bOk;
> STARTUPINFO si;
> PROCESS_INFORMATION pi;
> sprintf (szCmd,"command.com copy aaaa.txt bbbb.txt");
> memset(&si,0,sizeof(STARTUPINFO));
> si.cb = sizeof(STARTUPINFO);
> si.wShowWindow = SW_SHOW;
> bOk = CreateProcess(NULL,szCmd,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
The first thing you need to do is add a /c parameter to your command line
as follows:
"command.com /c copy aaaa.txt bbbb.txt"
Once this is done and CreateProcess() still fails, then call
GetLastError() after CreateProces() to get extended error information.
This should give you a clue about the cause of the failure.
--
*------------------------------------------------------------
| J. Keith Wedinger
| Technical Specialist - The Limited, Inc.
| http://www.serve.com/uccats
|