I want a batch file that after running with standard access, checks the status of the firewall and if the firewall is disabled, start a file. But, if the firewall is enabled, show all allowed ports. Is this possible?
I am checking if the firewall is enabled or not by using the Windows registry value EnableFirewall
.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile
I am not sure if this is the right way.