Unsolved win10 firewall cause network connection failed
-
My qt program ran well on win7, but got a problem on win10. The program run as UDP client,it send message very well ,but can't receive because of the firewall. I want to solve this problem by writing code but not manual setting. What shoud I do? I tried to use netsh cmd to add rule to the firewall in the script of installer pack software NSIS,but nothing was changed.
the netsh cmd is:
netsh advfirewall firewall add rule name="test" dir=in action=allow program="c:\program files\Test\Test.exe" enable=yes security=authnoencap -
Hi, perhaps there's a problem with the path or the Admin password prompt, if you know in advance which UDP port number you'll be using, you could try a netsh to open the that port, for example if it's 7777:
netsh advfirewall firewall add rule name="Open test port" dir=in action=allow protocol=UDP localport=7777
-
This post is deleted! -
@hskoglund Thanks for your advice, I tested it, but it is invalid for my situation ,any other suggestion?