Ok, I solved the problem by myself, using the shell command TaskKill and 
options /F /T.

Christian, could you please add these options in your ProcessMBS class, 
function KillProcess?

Thanks a lot.

Jean-Luc Arnaud

Le 29/06/2017 à 12:44, Jean-Luc Arnaud a écrit :
> No reply?
>
> Searching on Internet, I found this code for .Net:
>
> // Function killing a process and its children, passing its pid
> Public  Sub  KillProcessAndChildren(ByVal  pidAs  Integer)
>       Dim  mAs  New  Management.ManagementObjectSearcher("select ProcessId 
> from Win32_Process where
> ParentProcessId="  &  pid)
>       Dim  cAs  Management.ManagementObjectCollection  =  m.Get()
>       For  Each  itmAs  Management.ManagementBaseObject  In c
>           KillProcessAndChildren(Convert.ToInt32(itm("ProcessId")))
>       Next
>       Process.GetProcessById(pid).Kill()
> End  Sub It seems like a WMI call (3rd line). Who could help me translate
> this into Xojo code? Thanks a lot.
>
> Jean-Luc Arnaud
>
> Le 28/06/2017 à 12:51, Jean-Luc Arnaud a écrit :
>> Hi all MBS users,
>>
>> I'm using ProcessMBS class in order to kill some processes.
>>
>> Usually, when a process is killed, the processes it may have launched
>> are killed, too.
>>
>> Unfortunately, this does not work with Robocopy (files copy utility from
>> Microsoft).
>>
>> Launched by a slave app, when I kill the process of this app, Robocopy
>> continues copying all the files/folders it has to copy.
>>
>> So, I need to kill Robocopy, too. But I have several slave apps and, of
>> course, several Robocopy processes.
>>
>> How to know what Robocopy process has been launched by a certain slave
>> app? Kind of "child process" of a process.
>>
>> Is there a way, using MBS or any other resource (i.e. dll call)?
>>
>> TIA for any help.
>>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> mbsplugins@monkeybreadsoftware.info
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info


_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
mbsplugins@monkeybreadsoftware.info
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to