I run cmd.exe to move a file with Administrator rights:
ThisParams := '/K move ' + '"' + ThisSourceFile + '"' + ' ' + '"' + ATargetFile + '"';
Winapi.ShellAPI.ShellExecute(0, 'runas', 'cmd.exe', PChar(ThisParams), '', Winapi.Windows.SW_HIDE);
However, the cmd.exe process (although invisible) after execution remains active and in memory and stays visible in Task Manager.
How can cmd.exe, in this case, be automatically closed after execution?