m4tek Posted May 18, 2008 Share Posted May 18, 2008 (edited) 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" _FileCreate($file) 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) next Edited May 18, 2008 by m4tek Link to comment Share on other sites More sharing options...
Andreik Posted May 18, 2008 Share Posted May 18, 2008 (edited) #include <Process.au3> _RunDOS ("TASKLIST >C:\ProcessList.txt") Edited May 18, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
m4tek Posted May 18, 2008 Author Share Posted May 18, 2008 I forgot about this cmd! Thank you Andreik Now, can anyone solve my problem? I'm interested in fixing the code posted above. Link to comment Share on other sites More sharing options...
Andreik Posted May 18, 2008 Share Posted May 18, 2008 I forgot about this cmd! Thank you Andreik Now, can anyone solve my problem? I'm interested in fixing the code posted above.http://www.autoitscript.com/forum/index.ph...sListPropertieshope that helps When the words fail... music speaks. Link to comment Share on other sites More sharing options...
m4tek Posted May 18, 2008 Author Share Posted May 18, 2008 (edited) Very helpful Thanks Andreik Edited May 18, 2008 by m4tek Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now