Sign in to follow this  
Followers 0
harvey

help to ProcessExists

6 posts in this topic

#1 ·  Posted (edited)

hello everybody.

i want to check multi ProcessExists name's i tried that but it's not working

If ProcessExists("newfolder.exe"scvhost.exe"ognlfa.exe"qimpkc.exe"mbhqku.exe"kwafva.exe"jdsnhs.exe"fkctn.exe") Then
        MsgBox(0, "Example", "newfolder virus is running.")
ProcessClose("newfolder.exe"scvhost.exe"ognlfa.exe"qimpkc.exe"mbhqku.exe"kwafva.exe"jdsnhs.exe"fkctn.exe")
    Else
        MsgBox(0, "Example", "your pc clean.")
    EndIf

btw i know that i can use this code but i look for any way look like previous way

If ProcessExists("newfolder.exe") Then
  ProcessClose("newfolder.exe")
EndIf
  If ProcessExists("scvhost.exe") Then
  ProcessClose("scvhost.exe")
EndIf
        If ProcessExists("ognlfa.exe") Then
  ProcessClose("ognlfa.exe")
EndIf

thx in advanced

Edited by harvey

Share this post


Link to post
Share on other sites



hello everybody.

ProcessExists("newfolder.exe"scvhost.exe"ognlfa.exe"qimpkc.exe"mbhqku.exe"kwafva.exe"jdsnhs.exe"fkctn.exe")

No, no you can not.

Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

Have a look at Process List

; List all processes
Local $list = ProcessList()
For $i = 1 To $list[0][0]
    MsgBox(0, $list[$i][0], $list[$i][1])
Next

Maybe you could read the outputs in an array then check them against your list

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Make an array containing your processes

Dim $aProcesses[10] = ["newfolder.exe", "svchost.exe",....]

Then use a For Loop

For $n = 0 To UBound( $aProcesses ) - 1
If ProcessExists( $aProcesses[$n] ) Then
  ProcessClose( $aProcesses[$n] )
EndIf
Next

#EDIT

by the way: Closing svchost.exe causes the system to crash

Edited by jWalker

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@Chimaera

thx for your help i tried that before i post this topic but it's not working

Local $list = ProcessList("newfolder.exe", "scvhost.exe", "mbhqku.exe", "kwafva.exe")
For $i = 1 To $list[0][0]
    MsgBox(0, $list[$i][0], $list[$i][1])
Next

@jWalker

thx for your help that's what i wanted.but i faced problem when i try to use (else) in my script

anyway this is asimple of what i trying to make

Dim $aProcesses [10] = ["newfolder.exe", "scvhost.exe", "mbhqku.exe", "kwafva.exe"]
For $n = 0 To UBound( $aProcesses ) - 1
  if Not ProcessExists( $aProcesses[$n] ) Then
        MsgBox(0, "result", "your pc clean.")
Else
If ProcessExists( $aProcesses[$n] ) Then
ProcessClose( $aProcesses[$n] )
FileSetAttrib (@WindowsDir & "newfolder.exe" ,"-RSH")
FileDelete(@WindowsDir & "newfolder.exe")
FileSetAttrib (@WindowsDir & "scvhost.exe" ,"-RSH")
FileDelete(@WindowsDir & "scvhost.exe")
FileSetAttrib (@WindowsDir & "mbhqku.exe" ,"-RSH")
FileDelete(@WindowsDir & "mbhqku.exe")
EndIf
MsgBox(0, "result", "files deleted.")
EndIf
Next

i made an .exe and i renamed it new folder in windows to test my script

but the massage of (your pc clean) appeared about 10 times so any suggestion to solve that

btw this is my first script in this great language and i searched about Dim $aProcesses array in help file but i didn't get info so I'm sorry for my noob question

Edited by harvey

Share this post


Link to post
Share on other sites

@Chimaera

thx for your help i tried that before i post this topic but it's not working

Local $list = ProcessList("newfolder.exe", "scvhost.exe", "mbhqku.exe", "kwafva.exe")
For $i = 1 To $list[0][0]
    MsgBox(0, $list[$i][0], $list[$i][1])
Next

@jWalker

thx for your help that's what i wanted.but i faced problem when i try to use (else) in my script

anyway this is asimple of what i trying to make

Dim $aProcesses [10] = ["newfolder.exe", "scvhost.exe", "mbhqku.exe", "kwafva.exe"]
For $n = 0 To UBound( $aProcesses ) - 1
  if Not ProcessExists( $aProcesses[$n] ) Then
        MsgBox(0, "result", "your pc clean.")
Else
If ProcessExists( $aProcesses[$n] ) Then
ProcessClose( $aProcesses[$n] )
FileSetAttrib (@WindowsDir & "\newfolder.exe" ,"-RSH")
FileDelete(@WindowsDir & "\newfolder.exe")
FileSetAttrib (@WindowsDir & "\scvhost.exe" ,"-RSH")
FileDelete(@WindowsDir & "\scvhost.exe")
FileSetAttrib (@WindowsDir & "\mbhqku.exe" ,"-RSH")
FileDelete(@WindowsDir & "\mbhqku.exe")
EndIf
MsgBox(0, "result", "files deleted.")
EndIf
Next

i made an .exe and i renamed it new folder in \windows to test my script

but the massage of (your pc clean) appeared about 10 times so any suggestion to solve that

btw this is my first script in this great language and i searched about Dim $aProcesses array in help file but i didn't get info so I'm sorry for my noob question

You can try learning from this task manager I've been making, I put it together from a few scripts I've found made by some of the forums most insightful.


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

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