I am having similar problem with trying to remove files from Winsxs folder using StartComponentCleanup. I started task Scheduler wiith 14994 fies and ran StartComponentCleanup as administrator, after 2 hours i stopped it and still had 14,994 files. This means that old files as well as files that are no longer necessary can still be taking up hard disk space. For instance, Figure A shows the WinSxS folder properties dialog on a system that began as a Windows 7 system, which was upgraded to Windows 8.x and again to Windows 10.
-->
This topic is about the different ways to reduce the size of the WinSxS folder on a running version of Windows 10.
One commonly asked question is, 'Can I delete the WinSxS folder to regain some disk space?' The short answer is no. You can, however, reduce the size of the WinSxS folder using tools built into Windows. For more information about the WinSxS folder, see Manage the Component Store.
Windows 10 and Windows Server 2016 automatically reduce the size of the WinSxS folder by using methods similar to the ones described in this topic, in addition to internal processes, such as uninstalling and deleting packages with components that have been replaced by other components with newer versions. Previous versions of some components are kept on the system for a period of time, allowing you to rollback if necessary. After a period of time, these older components are automatically removed from the installation.
You can also reduce the size of a Windows image using some of the same techniques, as discussed in Reduce the Size of the Component Store in an Offline Windows Image.
To learn about finding the size of your WinSxS folder, see Determine the actual size of the WinSxS folder.
Warning
Deleting files from the WinSxS folder or deleting the entire WinSxS folder may severely damage your system so that your PC might not boot and make it impossible to update.
In Windows 10 and Windows Server 2016, you have a number of ways to start the cleanup of the component store, which use a combination of package deletion and component compression to clean up the WinSxS folder:
Task Scheduler
The StartComponentCleanup task was created in Windows 8 to regularly clean up components automatically when the system is not in use. This task is set to run automatically when triggered by the operating system. When run automatically, the task will wait at least 30 days after an updated component has been installed before uninstalling the previous versions of the component.
If you choose to run this task, the task will have a 1 hour timeout and may not completely clean up all files.
Run the StartComponentCleanup task in Task Scheduler to clean up and compress components
Dism.exe
The /Cleanup-Image parameter of Dism.exe provides advanced users more options to further reduce the size of the WinSxS folder. For more information, see DISM Operating System Package Servicing Command-Line Options.
Use the /StartComponentCleanup parameter
How to download and install network drivers without internet. Use the /ResetBase switch with the /StartComponentCleanup parameter
Use the /SPSuperseded parameter
Disk Cleanup
You can use Disk Cleanup to reduce the number of unnecessary files on your drives, which can help your PC run faster. It can delete temporary files and system files, empty the Recycle Bin, and remove a variety of other items that you might no longer need. The option to cleanup updates helps reduce the size of the component store.
Run Disk Cleanup to delete system files
Related topics
In last week's article, How to clean up system files with the Windows 10 Disk Cleanup tool, I told you about the WinSxS folder and how it can accumulate a lot of extraneous files. I then showed you how to enable and use the Cleanup System Files feature in the Disk Cleanup tool to remove unnecessary files from the WinSxS folder as well as from other locations on your hard disk.
More about Windows
In measuring the success of Disk Cleanup's work with the WinSxS folder, I mentioned that the Clean Up System Files feature removes only those files in the WinSxS folder that it determines are no longer needed by the system. As a result, you may find that a lot of files have been removed from your system—or that very few files have been removed from your system. It all depends on how many files Windows deems are necessary.
In this article, I'll show you another method you can use to take a whack at the WinSxS folder.
Warning!
Before I get started, I need to provide you with a warning. After the last article was published, I received a couple of emails from readers asking why you can't just open the WinSxS folder and delete everything in sight. That may sound like a good idea, but it's not. I should have included this warning in the first article.
Clean Up Winsxs Folder Win 10
The purpose of the WinSxS folder is to store all the files that the operating system may need to keep functioning stably during and after various update procedures. If you were to delete everything in the WinSxS folder, Windows would become severely unstable and could even be damaged so badly the system might not boot. And even if the system were able to boot, it would be impossible to update. So it's best to stick with the prescribed methods of cleaning up the WinSxS folder.
The Task Scheduler method
By default, Windows comes with a preconfigured task in Task Scheduler called StartComponentCleanup. While Task Scheduler will automatically run the StartComponentCleanup task on a regular basis, you can also run it manually at any time. Let's take a closer look.
The easiest way to launch Task Scheduler is to access the Run command by pressing [Windows]+R and typing taskschd.msc in the Open box, as shown in Figure A. To continue, click OK.
Figure AUse the Run command to launch Task Scheduler.
Once Task Scheduler launches, expand the console tree on the left and navigate to Task Scheduler LibraryMicrosoftWindowsServicing. Then, select StartComponentCleanup, as shown in Figure B.
Figure BThe StartComponentCleanup task runs on a regular basis.
Unfortunately, even though the StartComponentCleanup task runs on a regular basis, you really can't find out much about how and why it runs or even when it will run next. As you can see, the Triggers column is blank, as is the Next Run Time column. You'll also notice that the History option is disabled. All you can see for sure are the date and time in the Last Run Time column.
In most cases, the Last Run Result shows 'The operation completed successfully. (0x0).' However, as you can see on this example system, the Last Run Result is the code 0x800F080A, which is cryptic to say the least. As far as I've been able to determine, it translates to 'session object updated, must recreate session.' So I assume that indicates a failure.
To manually launch the StartComponentCleanup task, right click it and select Run from the context menu. The Status column will then read Running. When the StartComponentCleanup task runs, it analyzes the contents of the WinSxS folder and looks for files that are identified as being safe to remove and that have been in the folder for at least 30 days after the updated component has been installed.
Keep in mind that running the StartComponentCleanup task will take a long time—and there isn't a gauge, like the one in Disk Cleanup, to keep you informed of the progress of the operation. Also note that when you run the StartComponentCleanup task manually, it's configured to automatically stop the task if it runs longer than one hour.
What's your take?
Have you used the StartComponentCleanup task in Windows 10? If so, what kind of disk space savings did you encounter? Share your advice and experiences with fellow TechRepublic members.
Also read..
Microsoft Weekly Newsletter
Be your company's Microsoft insider with the help of these Windows and Office tutorials and our experts' analyses of Microsoft's enterprise products. Sony tv software update issues. Delivered Mondays and Wednesdays
Winsxs Folder Cleanup Windows 2012 R2Sign up today Sign up todayComments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |