Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

RUS: Уменьшение размера папки Winsxs в Windows 7 или как пользоваться WinsxsLite.bat

Attention!!! (Warnings)

1) Described procedure is very dangerous to OS, therefore before its application it is necessary to make a snapshot of a disk or partition by means of Acronis True Image or the similar program.

2) Procedure is executed the longtime — therefore plan time.

3) Procedure cannot process files blocked by any processes. Moreover, if procedure cannot process normally the blocked files, the risk sharply increases that then something does not work or the system will be spoiled. Therefore on procedure runtime, it is necessary to close all executable applications and to stop all possible services. But it is even better to execute procedure in «Save Mode» (F8) since in this case much less files it is blocked by system.

———————————————————————————————————————-

Introduction

Well here again faced shortage of a place on disk C:on a house computer.

The Analysis by means of the program FolderSizes showed that most of all places on a disk are occupied with a folder C:Windows, and in it a folder winsxs.

Started to investigate a problem from reading of articles. Here, for example, from one of developers Windows

What is the WINSXS directory in Windows 2008 and Windows Vista and why is it so large?

Very interesting article (truth it for Vista, at me 7)

Decrease of the sizes of a folder winsxs

By the way, is also official article of Microsoft on this problem — How to Alleviate Disk Space Pressure Caused By a Large Windows Component Store (WinSxS) Directory — but recommendations which there are given standard and hardly help to decrease a place.
©Bobrovsky Dmitry
It appears that the folder winsxs is main storage of system files on which hard-links become. The mechanism of operation with this storage is far from an ideal (IMHO). But certain guy Christian Bering Boegh wrote bat-file  WinsxsLite.bat which relink links to file most current release, and deletes all remaining versions as relinked and deleted files of unnecessary languages.
©Bobrovsky Dmitry
This Christian simply monster in a writing bat-files, such creates not everyone can …

In Help.htm at it it is written that bat-file makes irreversible changes i.e. if that goes not so the system will be spoiled also clear business better beforehand to snapshot of a disk.

So, vsp1cln.exe and compcln.exe I do not do, because at me Windows 7, but they like as are intended for Windows Vista.
Dmitry Bobrovsky
Since I downloaded bat-file with a set of all necessary utilities and Config.txt already was like as is correctly adjusted, it is necessary to launch bat-file simply. If Config.txt is not present, it is possible to launch bat-file simply and to select [q], Config.txt it will be generated.
Dmitry Bobrovsky
I decided to do on algorithm

Phase 1 scan
Phase 1 apply
Reboot
Phase 2 scan
Phase 2 apply
Reboot

To begin with I determine the size of a folder winsxs (through an explorer) is for control.

the Size: 4,16 Gb
The size on a disk: 4,22 Gb
Files: 29752
Folders: 7037

Generally the author bat-file states that the size of a folder winsxs in an explorer is determined incorrectly. Determine during experiment therefore the size by means of it bat-file (the menu [w]).

———————————————————————————————————————

Go …

1) I Download bat-file. (If there already is not present it is possible to search on WinsxsLite.bat).

2) (Picture 1 ). I launch bat-file WinsxsLite.bat . At start files multimedia files of examples are searched and is formed bat-file for their deleting DelWinsxsSampleMedia.bat (I execute it is it releases 30Мб for me). After that I look  the size of a folder winsxs — [w]. (Determination of the size as can be longtime, on my old notebook, approximately minutes 15 went).

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 1.

3) (Picture 2). Further I select [1] and [s] (scan), there is a long scanning (at me the order of 1 hour). The file ToDo1.txt with results of scanning is as a result formed. After that once again I select [1], but now the menu to become more variously and I select [a] (applay). Again there is a process (here already faster minutes 15-20) .

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 2.

4) (Picture 3). After execution of the first phase — 18 pending hardlink. Doing the first time, selected from the menu [A]uto start which did not fulfill on Windows 7. Doing the second time fulfilled Re[s]hchedule activation is WORKS, i.e. all links have been relinked.

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 3.

5) (Picture 4). I check the size. I so understand that it is necessary to be guided on free space. It was 15064 MB — was 15829 MB = 765 MB was released.

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 4.

6) Reboot. I think that in it there is no necessity, but just in case …

7) (Picture 5). I launch WinsxsLite.bat and I select [2] and [s]. There is a scanning process (much faster than in the first phase, minutes 10-15). During scanning the file ToDo2.txt is formed. After scanning I select [2] and [a]. There is an application process. In a picture 5 the message is visible that the file ToDo2.txt became outdated. For this reason in the documentation to be told that is better scanning and application to do in at one time differently if to do scan, and then in some days to apply results ToDo*.txt, its  contents can become irrelevant and the system can be spoiled.

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 5.

8) Reboot.

9) I Launch WinsxsLite.bat. the Program speaks to me that OS has not been rebooted and reboot (from what it is required?). Well all right I reboot once again.

10) I Launch WinsxsLite.bat. the program speaks that it is necessary to process pending hardlink and suggests to make either Auto start or Exit. I do [A]uto start. I reboot.

11) I Launch WinsxsLite.bat . Works autostart, something does.

Finish.

I Look the sizes (Picture 6). 16278-15064 = 1214 MB. The whole gigabyte was released.

Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat

Picture 6.

——————————————————————————————-

It is possible to make still [R]elocate folders — allows to move system folders on other disk. I suppose this point it is necessary to use only in case of extreme need. I did not do it.

And by the way on an explorer it turns out that places was released very little and for some reason a difference in 12 files … (Explorer really incorrectly shows the size of a folder winsxs).

the Size: 4,14 Gb
The size on a disk: 4,20 Gb
Files: 29740
Folders: 7037

Impression about bat-file in general positive, except a few tangled interface and the process and still is very longtime. Here if to rewrite all it under C# with a multithreading, I think would began to work faster.

Запись Decrease of the size of folder Winsxs in Windows 7 or how to use WinsxsLite.bat впервые появилась Dmitry Bobrovsky Blog

Запись опубликована в рубрике !ENG, WINDOWS. Добавьте в закладки постоянную ссылку.
  • Passerby

    Thank you for insight on winsxslite Dimitry, very useful information.

  • parapher

    Thank you so much, Dmitry. I was able to find up to v1.87 of WinSxSLite (couldn’t find v1.88 because the RS link is not available from the site). The original instructions (or lack thereof) for using the .bat file were not very clear, so I am thankful you wrote a detailed account of using it.

    I am currently running the script inside a VM install, and it is applying the Phase 1 scan now. I am using this on a Win7 install, btw. I want to see if this works, and even if I can sysprep such an install to capture the image later. That would be great, because even though the WinSxS content are indeed hardlinks for a large part, when capturing an image the deployment tools (dism, imagex, etc.) also count the hardlinks, just like explorer does. So in other words, even though the WinSxS contents may ‘just be hardlinks’, they are still counted when you create an image, so your images also grow, not just the installs!

    I agree with your assessment of Chris Bering’s work, and it is great and mind-boggling how he wrote such a script. I am not sure what the difference is between vLite’s approach to WinSxS reduction and Chris Bering’s approach of consolidating hardlinks. But I do know that when you use vLite on an image, it will break Windows Update, although you could technically integrate updates and/or install them in standalone fashion. With the WinSxSLite script you can still, supposedly, use WU and so the ability to update is not destroyed. I just hope WU doesn’t offer the dreaded System Update Readiness Tool.

    If I’m successful using WinSxSLite (v1.87) I’ll be back to comment.

  • Pingback: Liberar espacio en disco (guía y consejos) | Destacados()

  • kingofbytes

    This needs to be rewritten for WIndows 7. This program calls «subinacl.exe» which is not compatible with Windows 7. I even tried to set compatibility mode with no success. If the programmer can re-write using setacl, that would probably make this work for Win7.

    Thanks

  • Sabino D.

    Thank You!
    It worked like a charm, my win 7 ITA was shrinked from 24Gb to 20Gb after followed this method.

    Regards
    Sabino

  • Pingback: Instalar W7 en un disco sólido SSD de 32GB « Soloelectronicos()

  • Wim Cossement

    I also used it and used 1.86, it freed up almost 6 GB!
    You can get version 1.88 here: http://avcore.ru/winsxs-lite