OS_ProcessesKillAllByName

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > OS (Operating System) > OS_Process >

OS_ProcessesKillAllByName

 

Description

 

Kill all processed having a specific process name.

 

Syntax

 

s = OS_ProcessesKillAllByName(sProcessName)

 

Returns

 

String: JSON string buffer with number of killed processes and a list of killed processes

 

Parameters

 

Name

Type

Optional

Meaning

sProcessName

String

No

Name of the process to be killed

 

Remarks

 

Example of returned JSON info:

{
   "KilledProcesses": 3,
   "Processes": [
      {
         "Number": 1,
         "PID": 17608,
         "PID""Cmd.exe"
      },
      {
         "Number": 2,
         "PID": 26504,
         "PID""Cmd.exe"
      },
      {
         "Number": 3,
         "PID": 26148,
         "PID""Cmd.exe"
      }
   ]
}

 

Restrictions

 

See also

 

Examples

 

Uses "OS"
 
String NomeProcesso = "Cmd.exe"
string sOut
 
If OS_ProcessIsRunning(NomeProcesso) = 1 Then
  sOut = OS_ProcessesKillAllByName(NomeProcesso)
  msgbox 0, sOut
End If