2025-11-28 00:35:46 +09:00

40 lines
1.1 KiB
Markdown

---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
urlFragment: EnumerateFirewallRules
extendedZipContent:
- path: LICENSE
target: LICENSE
description: "Enumerates Windows Firewall rules."
---
# Enumerate Firewall Rules
Demonstrates Windows Firewall API's to enumerate firewall rules.
This sample is written in C++.
## Building the sample
To build the sample using the command prompt:
1. Open the Command Prompt window and navigate to the directory.
2. Type msbuild EnumerateFirewallRules.
To build the sample using Visual Studio:
1. Open Windows Explorer and navigate to the directory.
2. Double-click the icon for the .sln (solution) file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default Debug directory.
Additional Build Steps:
1. nmake
## Running the sample
1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
2. Type EnumerateFirewallRules.exe at the command line, or double-click its icon to launch it from Windows Explorer.