How to Use AppLocker to Allow or Block DLL Files from Running in Windows 10


AppLocker helps you control which apps and files users can run. These include executable files, scripts, Windows Installer files, dynamic-link libraries (DLLs), packaged apps (aka: Microsoft Store apps), and packaged app installers.

AppLocker defines DLL rules to include only the .dll and .ocx file formats.

The following table lists the default rules that are available for the DLL rule collection.

Any DLL file not allowed by the default rules below will automatically be blocked by default unless you create a new rule to allow it for a user or group.

If you want to block a DLL file allowed by the default rules below, you will need to create a new rule to block (deny) it for a user or group.

Purpose Name User Rule condition type
Allows members of the local Administrators group to run all DLLs (Default Rule) All DLLs BUILTIN\Administrators Path: *
Allow all users to run DLLs in the Windows folder (Default Rule) Microsoft Windows DLLs Everyone Path: %windir%*
Allow all users to run DLLs in the Program Files folder (Default Rule) All DLLs located in the Program Files folder Everyone Path: %programfiles%*

Important: If you use DLL rules, a DLL allow rule has to be created for each DLL that is used by all of the allowed apps.

Caution: When DLL rules are used, AppLocker must check each DLL that an app loads. Therefore, users may experience a reduction in performance if DLL rules are used.

See also:

This tutorial will show you how to use AppLocker to allow or block specified DLL (.dll and .osx) files to run for all or specific users and groups in Windows 10 Enterprise and Windows 10 Education.

You must be signed in as an administrator to use AppLocker.



Here's How:

1. Open an elevated command prompt.

2. Copy and paste the command below into the elevated command prompt, press Enter, and close the elevated command prompt when it has finished. (see screenshot below)

This command is to make sure the Application Identity service is enabled, set to Automatic, and running. AppLocker cannot enforce rules if this service is not running.

sc config "AppIDSvc" start=auto & net start "AppIDSvc"

Name:  Block_DLL_in_AppLocker-1.png
Views: 85
Size:  13.1 KB

3. Open Local Security Policy (secpol.msc).

4. Expand open Application Control Policies in the left pane of the Local Security Policy window, click/tap on AppLocker, and click/tap on the Configure rule enforcement link on the right side. (see screenshot below)

Name:  Block_DLL_in_AppLocker-2.jpg
Views: 99
Size:  84.9 KB

5. Click/tap on the Advanced tab, check the Enable the DLL rule collection box, and click/tap on Apply. (see screenshot below)

Name:  Block_DLL_in_AppLocker-3.png
Views: 87
Size:  29.5 KB

6. Click/tap on the Enforcement tab, check the Configured box under DLL rules, and click/tap on OK. (see screenshot below)

Name:  Block_DLL_in_AppLocker-4.png
Views: 88
Size:  28.4 KB

7. Expand open AppLocker in the left pane of the Local Security Policy window, right click or press and hold on DLL Rules, and click/tap on Create Default Rules. (see screenshots below)

If this step is not done, AppLocker will block all DLL files from running by default unless allowed by a created rule.

Name:  Block_DLL_in_AppLocker-5.jpg
Views: 90
Size:  56.8 KB Name:  Block_DLL_in_AppLocker-6.jpg
Views: 91
Size:  49.3 KB

8. Right click or press and hold on DLL Rules, and click/tap on Create New Rule. (see screenshot below)

Name:  Block_DLL_in_AppLocker-7.jpg
Views: 91
Size:  52.9 KB

9. Click/tap on Next. (see screenshot below)

Name:  Block_DLL_in_AppLocker-8.jpg
Views: 86
Size:  56.5 KB

10. If you would like to specify a user or group to enforce this rule on, click/tap on Select. (see screenshot below)

The default setting is Everyone for all users and groups.

Name:  Block_DLL_in_AppLocker-9a.jpg
Views: 86
Size:  49.2 KB

A) Click/tap on the Advanced button. (see screenshot below)

Name:  Block_DLL_in_AppLocker-9b.png
Views: 87
Size:  17.5 KB

B) Click/tap on the Find Now button. (see screenshot below)

Name:  Block_DLL_in_AppLocker-9c.png
Views: 84
Size:  26.8 KB

C) Select a user or group you want, and click/tap on OK. (see screenshot below)

Name:  Block_DLL_in_AppLocker-9d.jpg
Views: 87
Size:  78.1 KB

D) Click/tap on OK. (see screenshot below)

Name:  Block_DLL_in_AppLocker-9e.png
Views: 86
Size:  19.3 KB

11. Select (dot) Allow or Deny for what you want, and click/tap on Next. (see screenshot below)

Name:  Block_DLL_in_AppLocker-10.jpg
Views: 88
Size:  51.2 KB

12. Select (dot) Path, and click/tap on Next. (see screenshot below)

Name:  Block_DLL_in_AppLocker-11.jpg
Views: 93
Size:  58.3 KB

13. Do step 14 (file) or step 15 (folder/drive) below for the file or folder path you want to specify to allow or block.


 14. To Specify a DLL File Path to Allow or Block

A) Click/tap on the Browse Files button. (see screenshot below)

Name:  Block_DLL_in_AppLocker-12a.jpg
Views: 99
Size:  48.0 KB

B) Select if you want to allow or block a .dll or .ocx file in the drop menu at the bottom right corner. (see screenshot below)

C) Navigate to and select the .dll or .ocx file you want to allow or block.

D) Click/tap on Open, and go to step 16 below.

Name:  Block_DLL_in_AppLocker-12b.jpg
Views: 93
Size:  49.8 KB


 14. To Specify a Folder or Drive Path to Allow or Block All DLL Files in the Folder or Drive

A) Click/tap on the Browse Folders button. (see screenshot below)

Name:  Block_DLL_in_AppLocker-13a.jpg
Views: 88
Size:  47.9 KB

B) Navigate to and select a folder or drive you want to allow or block all DLL (.dll and .osx) files in.

C) Click/tap on OK, and go to step 16 below.

Name:  Block_DLL_in_AppLocker-13b.png
Views: 86
Size:  26.3 KB]

16. Click/tap on Next. (see screenshots below)

Name:  Block_DLL_in_AppLocker-12c.jpg
Views: 90
Size:  51.9 KB Name:  Block_DLL_in_AppLocker-13c.jpg
Views: 87
Size:  49.2 KB

17. Click/tap on Next. (see screenshots below)

Name:  Block_DLL_in_AppLocker-12d.jpg
Views: 92
Size:  61.5 KB Name:  Block_DLL_in_AppLocker-13d.jpg
Views: 89
Size:  56.8 KB

18. Click/tap on Create. (see screenshots below)

Name:  Block_DLL_in_AppLocker-12e.jpg
Views: 85
Size:  46.1 KB Name:  Block_DLL_in_AppLocker-13e.jpg
Views: 90
Size:  43.0 KB

19. Your new rule for "DLL Rules" will now be created. (see screenshot below)

Name:  Block_DLL_in_AppLocker-14.jpg
Views: 89
Size:  42.4 KB

20. Repeat steps 8 to 19 if you would like to create another new rule to allow or block another DLL file for a user or group.

21. When finished, you can close the Local Security Policy window.


That's it,
Shawn