Sign in to follow this  
Followers 0
themax90

Process List Generator

1 post in this topic

#1 ·  Posted (edited)

#include <Array.au3>
$file = "Processes.txt"
$sort = 0
;$file =  file to save generated list to
;$sort = -1 then no sorting
;$sort = 0 then sort acsending
;$sort = 1 then sort desending

$array = ProcessList()
$t = $array[0][0]
FileWriteLine($file, "Number of processes : " & ($t - 1))
$n = 1
Dim $arrayfinal[$t]
While $n <> $t
$arrayfinal[$n] = "Process : " & $array[$n][0] & "  PID : " & $array[$n][1]
WEnd
$n = 1
If $sort = 0 Then
_ArraySort($arrayfinal)
ElseIf $sort = 1 Then
_ArraySort($arrayfinal, $sort)
EndIf
While $n <> $t
FileWriteLine($file, $arrayfinal[$n])
WEnd

** FIXED ** just realized that the first number [0][0] in the array is number of files so made $n = 1 to accomidate!

Hope you like, just a small utility for those who wish.

:whistle:

Peace,

AutoIt Smith

Edited by AutoIt Smith

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  
Followers 0