How to use tasklist - 2 common examples

To help you get started, we’ve selected a few tasklist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rotki / rotki / frontend / app / src / py-handler.ts View on Github external
// 1. pyProc.kill() does not work due to SIGTERM not really being a signal
    //    in Windows
    // 2. the onefile pyinstaller packaging creates two executables.
    // https://github.com/pyinstaller/pyinstaller/issues/2483
    //
    // So the solution is to not let the application close, get all
    // pids and kill them before we close the app

    this.logToFile('Starting windows process termination');
    const executable = this.executable;
    if (!executable) {
      this.logToFile('No python sub-process executable detected');
      return;
    }

    const tasks: tasklist.Task[] = await tasklist();
    this.logToFile(`Currently running: ${tasks.length} tasks`);

    const pids = tasks
      .filter(task => task.imageName === executable)
      .map(task => task.pid);
    this.logToFile(
      `Detected the following running python sub-processes: ${pids.join(', ')}`
    );

    const args = ['/f', '/t'];

    for (let i = 0; i < pids.length; i++) {
      args.push('/PID');
      args.push(pids[i].toString());
    }
github Tarnadas / smmdb / src / net64 / components / views / MainView.js View on Github external
async scan () {
    const emulators = (await tasklist()).filter(el => el.imageName.includes('Project64')).map(el => ({
      name: el.imageName,
      pid: el.pid
    }))
    this.setState({
      emulators
    })
  }
  async onSelectEmulator (e) {

tasklist

Wrapper for the Windows `tasklist` command. Returns a list of apps and services with their Process ID (PID) for all tasks running on either a local or a remote computer.

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular tasklist functions