在Windows 7和Windows 8/10中,在 C:Windows 下有一个名为WinSxS的新文件夹,主要存放 dll 和组件文件。它还存储所有 dll 和组件文件的旧版本,并且可以变得非常大。除此之外,备份文件夹会占用大量空间,在安装Service Pack后会变得非常大,例如Windows 7的SP 1。
这是我在 Windows 7 上的WinSxS文件夹的大小:(WinSxS)
这是Windows 8/10 上WinSxS文件夹的大小:(WinSxS)
这是很大的空间,尤其是对于两个操作系统的全新安装!一旦您安装了更多Windows更新或任何服务包,它就会增加几GB(GBs)。不幸的是,这是Windows的超级核心文件集,因此您永远不想尝试自己删除任何内容。但是,您可以节省一点空间。
您可以做的第一件事是通过运行以下命令(开始(Start),键入CMD )来减小备份文件夹的大小:
dism /online /cleanup-image /spsuperseded /hidesp
如果发现任何服务包备份文件,它会自动清理它们。就我而言,我没有安装SP1,所以没有什么要删除的,因此我没有节省任何空间。您可以在带有SP1的 Windows 7和Windows Vista SP1上执行此操作,您可以使用不同的工具执行相同的操作。基本上(Basically),它会删除所有较旧的文件,但会使服务包无法删除。
对于Windows Vista SP1, 该文件称为 VSP1CLN.EXE ,对于Windows Vista SP2 ,该文件称为(Windows Vista SP2)COMPCLN.EXE。您可以通过单击Start然后键入Run来运行这些。出现“运行”(Run)对话框时,只需输入命令。
还有另一种方法可以删除Windows 7中(Windows 7)SP1的备份文件并使其永久化。只需(Simply)打开磁盘清理(Disk Cleanup)实用程序,单击清理系统文件(Clean Up System Files),然后选中服务包备份文件(Service Pack Backup Files)框。此外,如果存在这些选项,请务必检查Windows 更新清理(Windows Update Cleanup)和以前的 Windows安装。(Previous Windows)后者将显着减小整个 Windows 文件夹的大小(reduce the size of the entire Windows folder)。
再次重申,在Vista中您必须使用VSP1CLN和COMPCLN,而对于Windows 7,您必须使用DISM命令。使用其中任何一个都将使服务包永久化。其他人提到在WinSxS文件夹中压缩备份文件夹,但这可能不是一个好主意。做任何其他事情都会降低系统的可靠性。
您还可以运行另外两个命令来清除旧的或过时的组件。基本上(Basically),一旦您运行这些命令,您将无法卸载任何已安装的更新或服务包,因此请记住这一点。
DISM.exe /online /Cleanup-Image /StartComponentCleanup
DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
删除 Windows 功能
在Windows 8/10DISM命令添加了一些不错的新功能。您现在可以删除不再需要或不需要的软件包。您可以使用如下命令,或者您可以简单地使用添加和删除 Windows 功能(Add and remove Windows features)选项,它为您提供了一个不错的GUI。这是命令:
DISM.exe /Online /Disable-Feature /Featurename:<name> /Remove
那么你怎么知道你可以禁用哪些功能呢?好吧(Well),您可以运行以下命令来查看所有可用功能:
DISM.exe /Online /English /Get-Features /Format:Table
现在您有了列表,您可以禁用如下所示的SimpleTCP之类的功能:(SimpleTCP)
DISM.exe /Online /Disable-Feature /Featurename:SimpleTCP /Remove
很整洁啊!?如果您打算不使用默认内置的大量高级功能,那么这可以为您在Windows 8/10中节省大量空间。享受!
Cleanup the WinSxS Folder in Windows 7/8/10
In Windows 7 and Windows 8/10, there is a new folder under C:\Windows called WinSxS, which basically stores dll and component files. It also stores older versions of all dll and component files and can grow to be quite large. In addition to that, a lot of space is taken up by the backup folder, which gets really big after you install a Service Pack, like SP 1 for Windows 7.
Here’s the size of my WinSxS folder on Windows 7:
And here’s the size of the WinSxS folder on Windows 8/10:
That’s a lot of space, especially for fresh installs of both operating systems! Once you install more Windows updates or any service pack, it’ll shoot up a few more GBs. Unfortunately, this is a super core set of files for Windows, so you never want to try to delete anything yourself. You can, however, save a little space.
The first thing you can do is reduce the size of the backup folder by running the following command (Start, type CMD):
dism /online /cleanup-image /spsuperseded /hidesp
If any service pack backup files were found, it will automatically clean them up. In my case, I didn’t install SP1, so there was nothing to remove and hence I didn’t save any space. You can do that on Windows 7 with SP1 and on Windows Vista SP1, you can do the same thing using a different tool. Basically, it removes all the older files, but makes the service pack unremovable.
The file is called VSP1CLN.EXE for Windows Vista SP1 and it’s called COMPCLN.EXE for Windows Vista SP2. You can run these by clicking on Start and then typing in Run. When the Run dialog appears, just type in the commands.
There is also another way to remove the backup files for SP1 in Windows 7 and make it permanent. Simply open up the Disk Cleanup utility, click on Clean Up System Files and then check the Service Pack Backup Files box. Also, be sure to check Windows Update Cleanup and Previous Windows installations if those options are present. The latter one will reduce the size of the entire Windows folder significantly.
So again to reiterate, in Vista you have to use VSP1CLN and COMPCLN and for Windows 7 you use the DISM command. Using any of these will make the service pack permanent. Other people have mentioned compressing the backup folder inside the WinSxS folder, but that’s probably not a good idea. Doing anything else will reduce the reliability of your system.
You can also run two other commands that will clear out older or out-dated components. Basically, once you run these commands, you won’t be able to uninstall any installed updates or service packs, so keep that in mind.
DISM.exe /online /Cleanup-Image /StartComponentCleanup
DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
Remove Windows Features
In Windows 8/10, there are some nice new features added to the DISM command. You can now remove packages that you no longer want need or want. You can use the commands like below or you can simply use the Add and remove Windows features option, which gives you a nice GUI. This is the command:
DISM.exe /Online /Disable-Feature /Featurename:<name> /Remove
So how do you know what features you can disable? Well, you can run the following command to see all the available features:
DISM.exe /Online /English /Get-Features /Format:Table
Now that you have the list, you can disable a feature like SimpleTCP shown below:
DISM.exe /Online /Disable-Feature /Featurename:SimpleTCP /Remove
Pretty neat eh!? So that can save you a lot of space in Windows 8/10 if you plan on not using a lot of advanced features that are built-in by default. Enjoy!