Jump to content

Find number of threads given a PID


Go to solution Solved by user32462308,

Recommended Posts

Posted

Hi, I'm new to Autoit, but I'm hoping you guys can help me out.

Is there an "Autoit" way to get the number of threads a process is using, given the process id (PID)?

I know about ProcessList and ProcessGetStats, but neither of those have the current number of threads running for a process.

I tried searching around, and couldn't find anything. I might just be bad at searching.

Thanks!

  • Solution
Posted (edited)

Nevermind, I found this function via pastebin that executes a WMI query:

http://pastebin.com/jdnE6ZLG

I just used the QueryWMI function to select ThreadCount from Win32_Process as seen below:

$pid = Run("notepad.exe")

ConsoleWrite(QueryWMI("SELECT * FROM Win32_Process WHERE ProcessId = " & $pid & " DISPLAY ThreadCount"))

There is probably a better way, but this worked for me.

Edited by user32462308

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...