If you accidentally deleted the mysterious folder Microsoft warned all users to absolutely not delete, the company has now released a PowerShell script to help you restore it. The folder in question, ‘inetpub’, began appearing on users’ system drives (C:\) after the April 2025 security update for Windows 10 and 11.
While the folder does not appear to have any files, Microsoft confirmed that it plays a critical role in enabling protections for CVE-2025-21204, a security vulnerability in the Windows Update Stack.
To help users who may have deleted the folder, intentionally or unintentionally, Microsoft has shared a PowerShell script to restore the folder with the correct access control lists. Notably, this process does not require users to manually enable Internet Information Services (IIS), the web server platform with which the folder is associated.
To run the script, open PowerShell as Administrator and execute the following command to enable signed scripts and modules -
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassNext, copy and paste the following to download the script -
Install-Script -Name Set-InetpubFolderAcl -ForceIf a prompt asks you to install NuGet Provider, respond with Y to proceed, and run the above script again. Finally, to apply the fix, use the following command-
Set-InetpubFolderAclIn case you are left with a 'Command not found' error, add the full path-
& "C:\Program Files\WindowsPowerShell\Scripts\Set-InetpubFolderAcl.ps1"After successfully running the script, the inetpub folder should be created.
Back in April, the appearance of the inetpub folder left many users scratching their heads. Microsoft later clarified that the folder is a required component for securing systems against CVE-2025-21204, which involves “improper link resolution before file access” in the Windows Update Stack. This vulnerability could essentially allow an authorized attacker to gain elevated privileges if exploited.
While users can also recreate the folder by enabling IIS through “Turn Windows features on or off,” doing so adds additional system folders that many may prefer to avoid. That’s why Microsoft’s script-based method is the recommended approach if the folder has already been removed.
Even though the folder is empty and IIS may not be in use, deleting inetpub can compromise the effectiveness of the security patch, leaving systems potentially vulnerable. Microsoft emphasizes that the folder should not be removed under any circumstances.
Follow Tom's Hardware on Google News to get our up-to-date news, analysis, and reviews in your feeds. Make sure to click the Follow button.