Jump to content

Recommended Posts

Posted

Hello my friends!

I want a firewall exception to be turned on and off continuously when caps lock is on. I am looking to see if I am headed in the right direction.

Here is what I have so far:

Global Const $VK_CAPITAL = 0x14

ConsoleWrite(_GetCaps() & @LF)

Func _GetCaps()
    Local $ret
    $ret = DllCall("user32.dll","long","GetKeyState","long",$VK_CAPITAL)
    Return $ret[0]
EndFunc

While(CAPSLOCK == ON)
   Run('C:\Windows\System32\netsh.exe advfirewall firewall set rule name="TEST" new enable="yes"', "", @SW_HIDE)
   Sleep(1000)
   Run('C:\Windows\System32\netsh.exe advfirewall firewall set rule name="TEST" new enable="no"', "", @SW_HIDE)
   Sleep(1000)
WEnd

While(CAPSLOCK == OFF)
   Sleep(100)
WEnd

 

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
×
×
  • Create New...