Avoiding a Windows Firewall popup

前端 未结 3 1981
眼角桃花
眼角桃花 2021-02-06 02:51

My organisation produces a suite of Windows applications that make use of networking, and so when users run our software for the first time, the Windows Firewall (if it is runni

3条回答
  •  不要未来只要你来
    2021-02-06 03:20

    You can add exceptions to Windows Firewall by shelling out to netsh, a utility built into Windows, but the utility works differently on Windows XP and Windows 7. Here are the commands I used:

    Windows XP:

    add: netsh firewall add allowedprogram mode=ENABLE profile=ALL name=[exception name] program=[program path]

    remove: netsh firewall delete allowedprogram profile=ALL program=[program path]

    Windows 7:

    add: netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=[in|out] name=[exception name] program=[program path]

    remove: advfirewall firewall delete rule profile=any name=[exception name]

提交回复
热议问题