ShellExecute(0,'open','cmd.exe','/k ipconfig /flushdns', pchar(sysdir+'\system32\'),SW_HIDE);
How then to close cmd.exe correctly? in the processes it remains to hang after execution.
ShellExecute(0,'open','cmd.exe','/k ipconfig /flushdns', pchar(sysdir+'\system32\'),SW_HIDE);
How then to close cmd.exe correctly? in the processes it remains to hang after execution.
This function (ShellExecute) returns a number more than 32, if the execution is successful, otherwise - the error code. Msdn You can search for the application you have opened using the enumerator of processes. But it seems I know what you need to do. You are trying to execute the console command in the background, but you can’t do it discreetly. In this case, simply open cmd.exe с параметром /с
- in this case, the console will immediately close itself after the command is executed.
Source: https://ru.stackoverflow.com/questions/146028/
All Articles