Jump to content
Sign in to follow this  


Recommended Posts

Hey guys,

I want to script a program that's gonna create a txt file with all processes, their PIDs and memory usage. There's no problem with processes and PIDs because ProcessList() uses a 2-dimensional array. ProcessGetStats() uses a mono-dimensional array therefore it can't be listed in the .txt file the same way as ProcessList(). Does anyone have an idea on how to do it? Thanks in advance :)

#include <File.au3>
$file = "processlist.txt"

FileOpen($file, 1)
$list = ProcessList()
for $i = 1 to $list[0][0]
$pid = $list[$i][1]
$memory = ProcessGetStats($pid)
FileWrite($file, $list[$i][0] & "  " & $list[$i][1] & " " & $memory[0] & @CRLF)
Edited by m4tek

Share this post

Link to post
Share on other sites

I forgot about this cmd! Thank you Andreik :)

Now, can anyone solve my problem? I'm interested in fixing the code posted above.

Share this post

Link to post
Share on other sites

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
Sign in to follow this  

  • Create New...