Jump to content

Delete Default gateway on IEXPLORER.EXE exists


Recommended Posts

Hi

I need to make app that delete default gatway when ever IEXPLORER.EXE exists in process list i know command line to del default gatway

Run(@ComSpec & " /c " & 'netsh interface ip delete address "local area connection " gateway=all', "", @SW_HIDE);

i want to accpomplish app that delete gateway when IEEXPLORER.EXE in processor list .

app must be activated all time at tray to monitor

similar like that but this is just example help me how to do that properly ?

While 1
Sleep(100)

If ProcessExists("iexplorer.exe") Then
;Run(@ComSpec & " /c " & 'netsh interface ip delete address "local area connection " gateway=all', "", @SW_HIDE); 

Else
;   Run(@ComSpec & " /c " & 'netsh interface ip Add address "local area connection" gateway=192.168.1.254 gwmetric=2', "", @SW_HIDE); 
EndIf

WEnd
Edited by autoitxp
Link to comment
Share on other sites

finally i completed my script it works great for me . thanks all who helped me

Dim $explore[25] = ["iexplore.exe", "firefox.exe"]
Dim $Status[25] = [False]


While 1
    Sleep(100)

    For $i = 0 To 1
    If ProcessExists($explore[$i]) And $Status[$i] = False Then
   $Status[$i]  = True
            ConsoleWrite($explore[$i] &  " " & "Active" & @CRLF) 
  EndIf
    If Not ProcessExists($explore[$i])  And $Status[$i] = True Then
        $Status[$i]  = False
            ConsoleWrite($explore[$i] &  " " & "Not Active" & @CRLF)
EndIf
    
Next

WEnd
Link to comment
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
 Share

  • Recently Browsing   0 members

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