Jump to content

Firewall disable/enable.


Recommended Posts

Hey guys, I need some help. I don´t know how my script don´t work. Can you verfier it, please? Here is my source:

Sleep(20000)

$var = IniRead("C:\Windows\System\status.ini", "section2", "key", "NotFound")

If $var = "enabled" Then

Run("C:\Windows\System\disabled.exe")

EndIf

Ping("192.168.0.3",40000)

If @error = 0 Then

Msgbox(0,"Status","Online")

Do

Ping("192.168.0.3",40000)

Until @error <> 0

Run("C:\Windows\System\enabled.exe")

While 1 = 1

Do

Ping("192.168.0.3",40000)

Until @error = 0

Run("C:\Windows\System\disabled.exe")

Do

Ping("192.168.0.3",40000)

Until @error <> 0

Run("C:\Windows\System\enabled.exe")

Wend

Else

Run("C:\Windows\System\enabled.exe")

Do

Ping("192.168.0.3",40000)

Until @error = 0

Run("C:\Windows\System\disabled.exe")

While 1 = 1

Do

Ping("192.168.0.3",40000)

Until @error <> 0

Run("C:\Windows\System\enabled.exe")

Do

Ping("192.168.0.3",40000)

Until @error = 0

Run("C:\Windows\System\disabled.exe")

Wend

EndIf

The Problem: The script don´t wait of another Status. He change from disabled to enabled every (ca.) 20 seconds(So he execute ca. every 20 seconds a Run) When the user is online the script should WAIT until the user is offline and the execute. Can you help. Thank you for answers.

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