


Microsoft Wants You to Run a PowerShell Script If You've Deleted This Folder on Windows
Jun 26, 2025 am 03:03 AMHave you deleted the empty inetpub folder from your Windows installation drive, thinking it was of no use? If so, you should restore it using the PowerShell script that Microsoft has shared, as this folder is very important for your device’s security.
What Is the Inetpub Folder?
Microsoft regularly releases security updates to fix known issues. In April, they released security update KB5055523 for Windows 11 and KB5055518 for Windows 10. After downloading the update, many Windows 11 and 10 users, including myself, found a new inetpub folder in the Windows installation drive.

The folder is related to Internet Information Services (IIS), which allows developers to host websites or apps on Windows. This service is disabled by default but can be enabled through Windows Features. When the inetpub folder is created by IIS, you'll find various subfolders inside it, such as history, logs, temp, and more.
Since the inetpub folder created following the April security update for Windows 10 and 11 does not contain any sub-folders and was also found on devices without the IIS service enabled, it was widely believed that the folder was created due to a bug or glitch in the update. As a result, many users deleted it.

This Is Windows 11 Running on an iPad
Thank you, Europe!
Microsoft later updated the KB5055523 support document, stating that by downloading the security update, a new %systemdrive%inetpub folder will be created on your computer. This folder is created as part of the process that addresses a security vulnerability in the Windows Process Elevation service, which Microsoft refers to as CVE-2025-21204. The support document also mentions that the folder will appear on every system with the KB5055524 update installed, regardless of whether the IIS service is enabled or not.
As a heads-up, the CVE-2025-21204 vulnerability allows unauthorized agents to exploit symlinks to elevate their permissions for performing or manipulating file management operations using the Windows servicing stack and the inetpub folder on the Windows installation drive. To address this issue, Microsoft released the April security update, which pre-creates the inetpub folder in the Windows installation directory.
Don’t worry if you don’t understand some of the details here—the main point is that the inetpub folder is quite important for your security, and you should not delete it. But what if you have already deleted the folder?

I Made These 5 Changes to Windows Security for Optimal Safety
Outmaneuver the menace before it strikes.
4How to Restore the Inetpub Folder?
Since the inetpub folder is ultimately empty, you might consider creating a new folder named inetpub if you've deleted it. Unfortunately, this approach will not work.
As it turns out, the inetpub folder that Microsoft creates after installing the April update contains special permissions that cannot be replicated by creating the folder in the usual way. If you right-click the columns tab, select "More," and then check the "Owner" box, you'll see the Owner column in File Explorer.
This column shows "System" as the owner of the inetpub folder created by Microsoft, indicating that the folder has certain important permissions provided by Microsoft. Whereas the inetpub folder you create manually will display your username in the Owner column.

That said, there are three ways to restore the inetpub folder on your Windows computer. The first is by restoring the folder from the Recycle Bin. However, this method will only work if you have not permanently deleted the folder.
The next method is to enable the IIS service in Windows Features. To do this, open the Start Menu, type "Control Panel" in the search bar, and press Enter. In the Control Panel, navigate to Programs > Programs and Features > Turn Windows Features On or Off. Then, check the “Internet Information Services” box and click “OK.” After that, restart your computer, and you'll find the inetpub folder in your Windows installation drive.

However, enabling the IIS service also creates additional folders such as temp, history, log, and more on your computer. These folders are unnecessary unless you are a developer intending to host websites or apps on your machine.
Therefore, it is better to restore the inetpub folder using the PowerShell script provided by Microsoft. Running this script does not enable the IIS service, which means you'll not have to deal with all the extra subfolders that the service creates automatically.
Since you need to change folder ACLs (Access Control Lists) and install modules, launch Windows PowerShell with elevated permissions. Then, type the following command and press Enter.
<code>Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass</code>

Next, execute this command:
<code>Install-Script -NameSet-InetpubFolderAcl -Force</code>
If PowerShell prompts you to install the NuGet provider, type Y and press Enter. After that, run the previous command again.

Now, to create the inetpub folder, run this command:
<code>Set-InetpubFolderAcl</code>

If PowerShell displays an error message stating, “Command Not Found,” execute the following command:
<code>& "C:Program FilesWindowsPowerShellScriptsSet-InetpubFolderAcl.ps1"</code>
That’s it. After running the above commands, you’ll find the inetpub folder created in your Windows installation drive.

5 Easy Methods to Download Files Using PowerShell?
Grab files fast with PowerShell—no browser needed.
That was all about the inetpub folder, why you should not delete it, and what to do if you have already deleted it. Frankly, Microsoft could have handled the folder better, considering its importance. They could have at least set the folder’s attribute to Hidden. This way, fewer people would have come across this folder, which would have ultimately reduced the number of users who deleted it.
The above is the detailed content of Microsoft Wants You to Run a PowerShell Script If You've Deleted This Folder on Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

If you want to cancel the password login for Windows 11, there are three methods to choose: 1. Modify the automatic login settings, uncheck "To use this computer, users must enter their username and password", and then restart the automatic login after entering the password; 2. Switch to a passwordless login method, such as PIN, fingerprint or face recognition, configure it in "Settings>Account>Login Options" to improve convenience and security; 3. Delete the account password directly, but there are security risks and may lead to some functions being limited. It is recommended to choose a suitable solution based on actual needs.

Like many Windows users, I am always on the lookout for ways to boost my productivity. Command Palette quickly became an essential tool for me. This powerful utility has completely changed how I interact with Windows, giving me instant access to the

There are three main ways to uninstall programs on Windows 11: 1. Uninstall through "Settings", open the "Settings" > "Apps" > "Installed Applications", select the program and click "Uninstall", which is suitable for most users; 2. Use the control panel, search and enter "Control Panel" > "Programs and Functions", right-click the program and select "Uninstall", which is suitable for users who are accustomed to traditional interfaces; 3. Use third-party tools such as RevoUninstaller to clean up more thoroughly, but pay attention to the download source and operation risks, and novices can give priority to using the system's own methods.

To run programs as administrator, you can use Windows' own functions: 1. Right-click the menu to select "Run as administrator", which is suitable for temporary privilege hike scenarios; 2. Create a shortcut and check "Run as administrator" to achieve automatic privilege hike start; 3. Use the task scheduler to configure automated tasks, suitable for running programs that require permissions on a scheduled or background basis, pay attention to setting details such as path changes and permission checks.

This might not be at the top of the list of features people want to return from Windows 10, but it still offers some usefulness. If you'd like to view the current minutes and seconds without turning on that display in the main taskbar clock (where it

Windows 10 KB5061087 is now rolling out as an optional preview update for those on version 22H2 with Start menu fixes.

Microsoft confirmed that the DHCP server service might stop responding or refuse to connect after the June 2025 Update for Windows Server.

In the past, I always viewed the i5 lineup as anemic when it came to gaming. However, in 2025, a mid-range CPU is more than enough to start your gaming journey. Many games still don’t fully utilize multi-core performance as well as they could, so
