11-10-20 02:46 AM
30-11-22 05:14 PM
02-12-22 05:11 PM
13-12-22 08:03 AM
13-12-22 08:16 AM
Success = False
Dim bProcFound as Boolean = True
Dim iLoop as Integer = 0
Dim myProcesses() As System.Diagnostics.Process
Dim instance As System.Diagnostics.Process
Try
Do While bProcFound = True AND iLoop < timeOut
myProcesses = System.Diagnostics.Process.GetProcessesByName(Process_Name)
for each p as System.Diagnostics.Process in myProcesses
if iLoop = 0 OR iLoop Mod 3 = 0 then
try
p.CloseMainWindow()
p.kill()
catch ex As Exception
Msg &= iLoop & ":" & Process_Name & " - " & ex.Message
end Try
end if
next
bProcFound = False
For Each instance In myProcesses
bProcFound = True
Next
Threading.Thread.Sleep(200)
iloop += 0.2
Loop
if iLoop >= timeOut then Msg = "Timeout"
if not bProcFound then Success = True
Catch
End Try
Another way to do this is using a cmd file. Create a killChrome.cmd with "taskkill /im chrome.exe /f"
Now use Utility Environment > Start Process. Use "cmd" in Application and "/c <path>\killChrome.cmd"
Hope this Helps,
Regards