inetpub folder windows
Home » How to » Restore inetpub

“inetpub” Folder Deleted? 3 Ways to Restore it in Windows

If you accidentally deleted that random “inetpub” folder in Windows, you are not alone. Ever since this empty folder showed up on Windows 10 and Windows 11 devices after installing the KB5055518 and KB5055523 security updates, respectively, many have deleted it, confusing the folder with leftover data from the update. But pretty soon, Microsoft updated the release notes to highlight that you shouldn’t delete the “inetpub” folder.

The updated release notes read,

After installing this update or a later Windows update, a new %systemdrive%\inetpub folder will be created on your device. This folder should not be deleted regardless of whether Internet Information Services (IIS) is enabled on the target device. This behavior is part of changes that increase protection and does not require any action from IT admins and end users. For more information, see CVE-2025-21204

For the unversed, CVE-2025-21204 is a vulnerability in the Windows Update Stack that allows threat actors to gain access to SYSTEM-level processes. I won’t get too deep into the technical aspects. You can read all about it on Microsoft’s official website.

What is the inetpub folder in Windows?

The “inetpub” folder stores data related to Internet Information Services (IIS), especially the logs. On Windows PCs with the KB5055518 or KB5055523 updates installed, the folder boosts protection and security against the CVE-2025-21204 vulnerability.

But if you have IIS disabled, the “inetpub” folder will be empty, as was the case this time, which led to all this confusion in the first place.

What can I do after deleting the inetpub folder in Windows?

If you deleted the “inetpub” folder, fret not! It’s just as easy to restore the folder. You have three options for it, but running a short script in Windows PowerShell, by far, remains the most effective. We will start with that and move on to the other solutions.

1. Restore inetpub via Windows PowerShell

  1. Press Windows + S to open Search, type Terminal, and click on Run as administrator.
  2. Click Yes in the UAC prompt.
  3. In the Windows PowerShell tab under Terminal, paste the following commands and hit Enter after each:
    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
    Install-Script -Name Set-InetpubFolderAcl -Force
    Set-InetpubFolderAcl

    powershell script to restore inetpub folder
  4. If, after running the second command, you are prompted to install the NuGet provider, press Y, hit Enter, and run the command again.

These commands have been shared by Microsoft to restore the deleted “inetpub” folder in Windows. So, they are completely safe, and don’t populate the folder or the “C:” drive with other non-critical files, as is the case with other solutions!

2. Enable Internet Information Services (IIS)

  1. Press Windows + S to open Search, type Turn Windows features on or off, and click on the correct result.
  2. Tick the checkbox for Internet Information Services, and click OK.
    Internet Information Services
  3. Wait for Windows to install the component.

Once it’s completed, you will find a new “inetpub” folder in the “C:” drive on your Windows PC. If it’s there, go ahead and disable Internet Information Services, and the folder won’t get deleted.

Remember, enabling Internet Information Services will also create other folders and add a bunch of related files to the PC.

3. Recover the folder from Recycle Bin

Lastly, if you haven’t emptied the Recycle Bin after deleting the “inetpub” folder, there’s always the option to recover it.

Honestly, it’s the simplest solution, but not one that would work for all of you. That’s why, I have listed it at the bottom.


Lesson learned – Don’t delete files in the C: (or system) drive

I can’t stress enough: never delete files from the system drive, which is usually “C:“. Most of these files and folders are linked to Windows, and deleting any might affect the PC’s stability, security, or performance. The entire episode with the “inetpub” folder reinforces this point.

And that’s precisely why I recommend opting for Storage Sense over Disk Cleanup, because with the latter, you always run the risk of deleting system files.


Now that you have restored the “inetpub” folder in Windows, make it a habit not to play around with files/folders in the system drive. While this particular issue had a simple fix, others usually don’t. And you may even run into a Blue Screen of Death error!

For any queries or to share which method worked best for you, drop a comment below.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top