ashley Posted January 19, 2009 Posted January 19, 2009 I need to check the process list and then check them against my file. My file is like this: wow.exe ; Trusted something.exe ; No action something1.exe ; Untrusted ect... I need to check the processes and if its in my list as untrusted, then exit process. If its in not in my file then i have some code to add them to files. How would i do this? Thanks in advance Free icons for your programs
FireFox Posted January 19, 2009 Posted January 19, 2009 (edited) @ashley ProcessList , FileWrite , FileRead Edit : Example Write processlist in a file, wait some sec and do another processlist then check for all line if the process is in.. Cheers, FireFox. Edited January 19, 2009 by FireFox
weaponx Posted January 19, 2009 Posted January 19, 2009 Asked a couple times before:http://www.autoitscript.com/forum/index.ph...mp;#entry414931http://www.autoitscript.com/forum/index.ph...detect++process
azure Posted January 19, 2009 Posted January 19, 2009 (edited) I need to check the process list and then check them against my file. My file is like this: wow.exe ; Trusted something.exe ; No action something1.exe ; Untrusted ect... I need to check the processes and if its in my list as untrusted, then exit process. If its in not in my file then i have some code to add them to files. How would i do this? Thanks in advance Quick and Dirty: #include <Array.au3> #include <file.au3> $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colProcessList = $objWMIService.ExecQuery("Select * from Win32_Process") $file = fileopen("C:\process.txt",0) If $file = -1 Then MsgBox(0, "Error", "Unable To Open File.") Exit EndIf Dim $procarray[1][2] $icount = 1 $i = 0 While 1 $line = FileReadLine($file) If @Error = -1 Then ExitLoop $tempArray = StringSplit($line,";") $procArray[$i][0] = $tempArray[1] $procArray[$i][1] = $tempArray[2] $icount = $icount + 1 $i = $i + 1 ReDim $procArray[$iCount][2] WEnd FileCLose($file) ;_ArrayDisplay($procArray) For $objProcess In $colProcessList ConsoleWrite($objProcess.Name) For $iSearch = 0 To UBound($procArray)-1 If $objProcess.Name = $procArray[$iSearch][0] Then ConsoleWrite(@TAB & "<---" & $procArray[$iSearch][1]) EndIf Next ConsoleWrite(@CRLF) Next C:\process.txt explorer.exe;No Action csrss.exe;No Action Edited January 19, 2009 by azure
NerdFencer Posted January 19, 2009 Posted January 19, 2009 I would probably store the list as an ini, then use InireadSection to grab the process names and corresponding actions with the ini being something like... [processes] explorer.exe=No Action some process.exe=Untrusted WOW.exe=Trusted _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell
ashley Posted January 19, 2009 Author Posted January 19, 2009 I would probably store the list as an ini, then use InireadSection to grab the process names and corresponding actions with the ini being something like... [processes] explorer.exe=No Action some process.exe=Untrusted WOW.exe=Trusted would this be eaiser? Free icons for your programs
Developers Jos Posted January 19, 2009 Developers Posted January 19, 2009 Ashley, my patience with you is gone .... You know better than to be impatient on these forums. You either start doing the scripting yourself and ask questions about the stuff you have tried to solve yourself first or please just ga away. *click* SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts