Jump to content

Recommended Posts

Posted

my program uses a tcp connection to connect via a network...whenever i install a client program in the computers connected to the network, it is 1st blocked by the windows firewall... if i unblock then it runs

i wnated to know of a way to directly run the program without the firewall blocking it...

Posted

Have you tried adding code in your script to disable the firewall through cmd?

Run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall opmode disable" & @CRLF)

WinClose("C:\WINDOWS\system32\cmd.exe"

=============================================

To add your script to the exceptions list so that it does not get blocked try this. (in sace you want to kepp the firewall up)

run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall set allowedprogram c:\yourprogram.exe ProgramName ENABLE" & @CRLF)

WinClose("C:\WINDOWS\system32\cmd.exe"

===========================================

To add the port itself:

run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall set portopening (PROTOCOL Ex, TCP) (PORT NUMBER) (NameForDescription)" & @CRLF) <--without parentesis around protocol, portnumber and name description-------->

WinClose("C:\WINDOWS\system32\cmd.exe"

I hope this helps. I am new with autoit, so there might be other ways to do it that I have not found yet.

Posted

Have you tried adding code in your script to disable the firewall through cmd?

Run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall opmode disable" & @CRLF)

WinClose("C:\WINDOWS\system32\cmd.exe"

=============================================

To add your script to the exceptions list so that it does not get blocked try this. (in sace you want to kepp the firewall up)

run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall set allowedprogram c:\yourprogram.exe ProgramName ENABLE" & @CRLF)

WinClose("C:\WINDOWS\system32\cmd.exe"

===========================================

To add the port itself:

run("cmd.exe", "c:\windows\system32\)

WinWaitActive("C:\WINDOWS\system32\cmd.exe") <------- Title might be diferent

Send("netsh firewall set portopening (PROTOCOL Ex, TCP) (PORT NUMBER) (NameForDescription)" & @CRLF) <--without parentesis around protocol, portnumber and name description-------->

WinClose("C:\WINDOWS\system32\cmd.exe"

I hope this helps. I am new with autoit, so there might be other ways to do it that I have not found yet.

wonderful suggestion ill try it out...

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