Sign in to follow this  
Followers 0
SjaakTV

Export ProcessList() to notepad.

3 posts in this topic

Hi,

so I want to make a easy script that checks all running proces and puts them in a .txt file.

I start of with checking how.

$list = ProcessList()
for $i = 1 to $list[0][0]
  msgbox(0, $list[$i][0], $list[$i][1])
next

Autoit gives me this. It shows all proces in a msg.

The problem with this for me is the $list[0][0], $list[$i][0], $list[$i][1] i don't realy get that.

So i made this.

$Proces = ProcessList()
    $a = GUICtrlRead($Proces)                           
    $file1 = FileOpen("proces.txt", 1)              
    FileWriteLine($file1, $a)                           
    FileClose($file1)

Bad thing is it keeps droping a 0 in the textfile idk why.

I thought it might drop 1 all processes or atleast one but a 0 why/how?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Like this?

$fname = "processes.txt"
$file = FileOpen($fname, 9)

$list = ProcessList()

for $i = 1 to $list[0][0]
    FileWriteLine($file, "Process Name: " & $list[$i][0] & " PID: " & $list[$i][1] & @CRLF)
next

FileClose($file)
Edited by Steveiwonder

They call me MrRegExpMan

Share this post


Link to post
Share on other sites

This is the proces name= $list[$i][0]

This is the proces number = $list[$i][1]

Thnx man :( now i get it.

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