harvey Posted February 8, 2012 Share Posted February 8, 2012 (edited) hello everybody. i want to check multi ProcessExists name's i tried that but it's not workingIf 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.") EndIfbtw i know that i can use this code but i look for any way look like previous wayIf 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") EndIfthx in advanced Edited February 8, 2012 by harvey Link to comment Share on other sites More sharing options...
Skitty Posted February 8, 2012 Share Posted February 8, 2012 hello everybody. ProcessExists("newfolder.exe"scvhost.exe"ognlfa.exe"qimpkc.exe"mbhqku.exe"kwafva.exe"jdsnhs.exe"fkctn.exe") No, no you can not. Link to comment Share on other sites More sharing options...
Chimaera Posted February 8, 2012 Share Posted February 8, 2012 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 If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
jWalker Posted February 8, 2012 Share Posted February 8, 2012 (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 February 8, 2012 by jWalker Link to comment Share on other sites More sharing options...
harvey Posted February 8, 2012 Author Share Posted February 8, 2012 (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 February 8, 2012 by harvey Link to comment Share on other sites More sharing options...
Skitty Posted February 9, 2012 Share Posted February 9, 2012 @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. 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