Sign in to follow this  
Followers 0
sebsabul

Firewall disable/enable.

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



PLEASE HELP!

Share this post


Link to post
Share on other sites

Can nobody help?

Share this post


Link to post
Share on other sites

hello,

humm, maybe it's a problem of timing between the end of Run("....") and Ping(..).

Try to replace run(...) by runwait(....)

I hope it'll help you...


Share this post


Link to post
Share on other sites

THANK YOU! I WILL TRY IT!

Share this post


Link to post
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
Sign in to follow this  
Followers 0