I believe it's a little more complicated as RoboCopy kicks of other process threads to copy files and killing the main process may eventually stop o copy or it may not.
There's a thread about it on stack overflow and I seem to recall the issue on large file copies where killing robocopy still continued copying these processes until they completed. Rather than terminating them.
https://stackoverflow.com/questions/44712364/batch-script-calling-robocopy-in-process-wont-terminate
So I think the key is to identify the child processes that are created, kill these and then kill the originating process.
Something like
Sub KillProcessAndChildren(PID As Integer)
Dim searcher As New ManagementObjectSearcher(String.Format("Select * From Win32_Process Where ParentProcessID={0}", PID))
Dim moc As ManagementObjectCollection = searcher.Get()
Try
For Each mo In moc
Try
KillProcessAndChildren(Convert.ToInt32(mo("ProcessID")))
Catch ex As Exception
'//Don't worry as simply trying to kill all children
End Try
Next
Dim proc = Process.GetProcessById(PID)
proc.Kill()
Catch ex As ArgumentException
' // Process already exited.
End Try
End Sub
For simple processes like Notepad - you can simply kill the process itself like KarenPayneOregon suggested