How to Restore 'inetpub' Folder on Windows 11, Windows 10

If you have deleted the ' inetpub ' folder, which was created after the Windows April 2025 Update - you need to restore it immediately, otherwise your system will remain vulnerable to potential security threats.

 

Microsoft has announced that this folder can be restored when you enable the IIS service, or you can also use a new PowerShell script released on May 28.

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 1

For those who don't know, Windows 11 24H2 and older versions of Windows, including Windows 10, created a folder called 'inetpub' after the April 2025 Updates. This empty folder is usually related to Internet Information Services (IIS) – a Windows native service that allows developers to host websites or apps on Windows 11.

Empty inetpub folder in Windows 11 KB5055523

In the case of Windows 11, Microsoft created a folder (C:inetpub) with KB5055523 or later, which contains nothing and the properties show that the folder is 0 bytes in size.

 

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 2

Microsoft has since updated their documentation to state that the 'inetpub' folder was created as part of the security patch for CVE-2025-21204, and that it will appear regardless of whether you have IIS enabled or not. Some advise against deleting it, and if you do, to restore it following Microsoft's previous instructions.

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 3

'The security vulnerability CVE-2025-21204 occurs due to an issue with improper link resolution before accessing files ('link following') in the Windows Update Stack, which could mean that, on unpatched devices, Windows Update could follow symbolic links in a way that allows a local attacker to trick the system into accessing or modifying unwanted files or folders,' Microsoft notes in the document.

Previously, Microsoft told Windows Latest that the 'inetpub' folder could be recreated with the same level of security by enabling Internet Information Services (IIS) from Control Panel > Programs > Programs & Features > Turn Windows features on or off.

 

Internet Information Services (IIS)

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 4

However, that's something most people don't want to do, because IIS also creates a lot of extra directories, which are unnecessary if you're not a developer.

If you accidentally deleted that folder, you can use a new PowerShell script that can recreate this folder, and you don't need to enable IIS anymore, as follows:

How to use PowerShell script to restore 'inetpub' and patch CVE-2025-21204

Step 1: Run PowerShell as Administrator.

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 5

You cannot do this with an account that does not have administrative privileges because we are trying to change directory permissions (ACLs) and install modules. These operations require admin privileges.

Step 2: In PowerShell, first enable signed scripts and modules from the Microsoft PowerShell Library using the following command: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass.

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 6

Step 3: Download the script from PowerShell Gallery with the command - Install-Script -Name Set-InetpubFolderAcl -Force

 

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 7

Step 4: Install NuGet Provider (if prompted): In some cases, you will be asked if you want to install 'NuGet Provider' if it is not already available. Just answer 'Y' to continue, then run the Install-Script command again.

How to Restore 'inetpub' Folder on Windows 11, Windows 10 Picture 8

Step 5: Run the script to recreate the folder: Set-InetpubFolderAcl

If you get an error like 'command not found', run the full path below

& "C:Program FilesWindowsPowerShellScriptsSet-InetpubFolderAcl.ps1"

After completing all the above steps, you will see the inetpub folder appearing again in your C drive.

4.5 ★ | 2 Vote

May be interested