weaponx Posted December 8, 2007 Share Posted December 8, 2007 Run Tidy on your script. There are a bunch of errors that need to be addressed. Link to comment Share on other sites More sharing options...
Innovative Posted December 8, 2007 Author Share Posted December 8, 2007 tidy ? you mean au3check ? i cant run that.. it runs and close before 2 secs -.- Link to comment Share on other sites More sharing options...
Innovative Posted December 8, 2007 Author Share Posted December 8, 2007 Can you please tell me which part is wrong because i dont have the tidy program =) thank you so much! Link to comment Share on other sites More sharing options...
weaponx Posted December 8, 2007 Share Posted December 8, 2007 I'm not sure if you realize this but you are doing exactly what I posted back at #2:#443501You shouldn't be hiding windows if this script is designed to kill rogue processes. You should be closing the process.You also shouldn't be declaring functions inside if / then / endifCheck this out, its a much simpler implementation:expandcollapse popup#include <process.au3> #include <misc.au3> Opt("GUIOnEventMode", 1) While 1 ;Store current processlist "state" ;[x][0]: Contains process name ;[x][1]: Contains process id Global $ListOne = ProcessList() While 1 ;[x][0]: Contains process name ;[x][1]: Contains process id Global $ListTwo = ProcessList() ;Verify each process exists in original state For $X = 1 To $ListTwo[0][0] $found = False ;Comparing by PID For $Y = 1 To $ListOne[0][0] If $ListOne[$Y][1] = $ListTwo[$X][1] Then $found = True ExitLoop EndIf Next ;If no match is found in ListOne for current process in ListTwo If $found = False Then $processString = "Name: " & $ListTwo[$X][0] & @CRLF $processString &= "ID: " & $ListTwo[$X][1] & @CRLF ;Retrieve process path $processString &= "Path: " & _GetProcessPath($ListTwo[$X][1]) & @CRLF $processString &= @CRLF & "Allow process to remain active?" $result = MsgBox(4 + 48,"ProcessDefender has detected a new process", $processString) If $result = 6 Then ;This will reset the first comparison state ExitLoop 2 Else ProcessClose($ListTwo[$X][1]) ExitLoop EndIf EndIf Next ;Check every second Sleep(1000) WEnd WEnd Func _WinGetByPID($iPID, $nArray = 1);0 will return 1 base array; leaving it 1 will return the first visible window it finds If IsString($iPID) Then $iPID = ProcessExists($iPID) Local $aWList = WinList(), $sHold For $iCC = 1 To $aWList[0][0] If WinGetProcess($aWList[$iCC][1]) = $iPID And _ BitAND(WinGetState($aWList[$iCC][1]), 2) Then If $nArray Then Return $aWList[$iCC][0] $sHold &= $aWList[$iCC][0] & Chr(1) EndIf Next If $sHold Then Return StringSplit(StringTrimRight($sHold, 1), Chr(1)) Return SetError(1, 0, 0) EndFunc ;==>_WinGetByPID Func _GetProcessPath($GPPpid) $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") $colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_Process WHERE processid = ' & $GPPpid, "WQL", 0x10 + 0x20) If IsObj($colItems) then For $objItem In $colItems Return $objItem.ExecutablePath Next Else Return "" Endif EndFunc Link to comment Share on other sites More sharing options...
therks Posted December 8, 2007 Share Posted December 8, 2007 I'm not sure if you realize this but you are doing exactly what I posted back at #2:I admire your patience. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Innovative Posted December 8, 2007 Author Share Posted December 8, 2007 weapon =) problem solve.. thanks you.. saunders i admire your dumbness too, you think this is a waste of time to post here but you still post ? Link to comment Share on other sites More sharing options...
weaponx Posted December 8, 2007 Share Posted December 8, 2007 Woah woah woah...no hostility please. 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