4 releases
0.3.0 | May 5, 2025 |
---|---|
0.2.15 | Jul 18, 2024 |
0.2.13 | Oct 12, 2023 |
0.2.12 |
|
0.1.9 |
|
#95 in Windows APIs
322 downloads per month
325KB
1.5K
SLoC
tasklist
a small crate let you can easily get tasklist and process information on windows
- based on
windows-rs
crate
what information you can get
- Process name,pid,parrentID,threadsID.
- Process start_time,exit_time,and CPU_time(including kernel time and user time).
- Process path and commandline params.
- Process SID and Domain/User.
- Process IO infomation , including all of
IO_COUNTERS
member. - Process memory information , including all of
PROCESS_MEMORY_COUNTERS
member. - Process handles information , use
GetProcessHandleCount
Api. - Process file infomation , use
GetFileVersionInfoExW
Api. - Check whether the process is running in the WOW64 environment and get architecture info (x86/x64/ARM etc.)
- Iterate over all processes.
- 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());
}
}
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(_) => (),
}
}
}
Usage
Add this to your Cargo.toml
:
[dependencies]
tasklist = "0.3.0"
Dependencies
~0–28MB
~459K SLoC