Jump to content

New Process


ashley
 Share

Recommended Posts

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

Link to comment
Share on other sites

@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 by FireFox
Link to comment
Share on other sites

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 by azure
Link to comment
Share on other sites

  • Developers

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.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...