process.kill

process.kill

process.kill

Function

Terminate the started child process. Under Windows, it will try to recursively terminate the child process tree of the process first, and then terminate the process itself.

Syntax

Parameters

No parameters.

Return value

TypeDescription
BoolReturns true if the termination signal is successfully sent; returns false if there is no child process handle or the process has exited.

Example

Notes

  • kill will not clear the currently saved child process handle.
  • Kill under Windows will recursively terminate the child process tree through the system process snapshot, which is suitable for canceling multi-level conversion tasks such as PowerShell, WPS, and poppler.
  • Under Linux/macOS, kill still terminates the direct child process; if the business requires cancellation at the process group level, it should be managed by the started external program itself.