Are there WFP apis that can disable / delete Firewall rules ?

Sinha Prokash 46 Reputation points

When a service ( .exe ) add firewall rules, it can have the Id's cached, and delete those rules as needed...

Now, client machine by default comes with quite a few rules ( that can be deleted or disabled using the defender firewall ). Is there equivalent APIs. May be enumeration based !!


Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,438 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 15,446 Reputation points Microsoft Vendor

    Hello, @Sinha Prokash
    Welcome to Microsoft Q&A!

    I can't find any relevant functionality in the WFP API.
    Hope this article can help you. It describes the operation of the firewall rule with Netsh and Powershell.

    Thank you.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.