#task-list #windows #process

tasklist

Get the tasklist and process information on windows

4 releases

0.3.0 May 5, 2025
0.2.15 Jul 18, 2024
0.2.13 Oct 12, 2023
0.2.12 Jul 18, 2022
0.1.9 Jun 30, 2022

#95 in Windows APIs

Download history 59/week @ 2025-01-22 40/week @ 2025-01-29 67/week @ 2025-02-05 22/week @ 2025-02-12 36/week @ 2025-02-19 55/week @ 2025-02-26 38/week @ 2025-03-05 60/week @ 2025-03-12 32/week @ 2025-03-19 52/week @ 2025-03-26 44/week @ 2025-04-02 40/week @ 2025-04-09 26/week @ 2025-04-16 52/week @ 2025-04-23 156/week @ 2025-04-30 83/week @ 2025-05-07

322 downloads per month

MIT license

325KB
1.5K SLoC

tasklist

tasklist-rs

a small crate let you can easily get tasklist and process information on windows

what information you can get

  1. Process name,pid,parrentID,threadsID.
  2. Process start_time,exit_time,and CPU_time(including kernel time and user time).
  3. Process path and commandline params.
  4. Process SID and Domain/User.
  5. Process IO infomation , including all of IO_COUNTERS member.
  6. Process memory information , including all of PROCESS_MEMORY_COUNTERS member.
  7. Process handles information , use GetProcessHandleCount Api.
  8. Process file infomation , use GetFileVersionInfoExW Api.
  9. Check whether the process is running in the WOW64 environment and get architecture info (x86/x64/ARM etc.)
  10. Iterate over all processes.
  11. Process termination functionality.

remember some infomation need higher privilege in some specific windows versions

example

Get all process pid , process name and user .

use tasklist;

fn main(){
   
    let tl = tasklist::Tasklist::new().unwrap();
    tasklist::enable_debug_priv();
    for i in tl{
        println!("{} {} {}",i.get_pid(),i.get_pname(),i.get_user());
    }
}

tasklist-rs

Get all process name , pid , company name , file description.

use tasklist;

fn main(){
    let tasks = tasklist::tasklist().unwrap();
    for i in tasks {
        match i.get_file_info(){
            Ok(info) => println!("{:?}", info.get("FileDescription")),
            Err(_) => (),
        }
    }
}

tasklist-rs

Usage

Add this to your Cargo.toml:

[dependencies]
tasklist = "0.3.0"

Dependencies

~0–28MB
~459K SLoC