📜 ⬆️ ⬇️

Reducing the size of the winsxs folder

Many owners of Windows Vista and 7 must have come across the fact that the Windows folder is growing by leaps and bounds over time. I put up with it until the 40-gig section with the system began to periodically give me messages that the free space on it ends.

I found one wonderful tool whose magic allows you to reduce the size of the winsxs folder without losing performance / stability / data. First, I did everything described under the cut on my home beech, and now for the purity of the experiment I will repeat it at work.

0. A bit of theory


In general, a lot has been said about how Windows uses system disk space, so here I will be brief.
')
pagefile.sys - paging file. It can be disabled with a large amount of RAM, you can adjust the size manually.

hiberfil.sys is a file in which a snapshot (snapshot) of RAM is saved when the computer is "falling asleep". In the "Disk Cleanup" menu, among other things, there is the point "Cleaning Hibernation Files". If you do not use this mode, you can clear. If you regularly “fall asleep” your computer / laptop, then, having cleared this file, you will have to use this advice , or simply type powercfg -h on && shutdown -r in the command line.

Personal folders of users (My Documents, Desktop, Appdata, Main Menu, etc.) can be safely transferred to another place through the properties of the necessary folders, as well as through regedit or group policies. This is a separate conversation, here I will not consider it.

It should be noted that any updates and upgrades in the Windows system are reversible, that is, by installing Vista Service Pack 2 (6.0.6002), you can roll back to 6.0.6001, and then to the original assembly. In order to make all updates installed in the system irreversible, you need to use two system utilities:
vsp1cln.exe - sweeps up garbage after installing Vista SP1.
compcln.exe - does the same for SP2.

The system creates restore points on demand and automatically when installing drivers, important updates, on a schedule or on demand. Recovery uses up to 15% of the space on each of the disks on which it is used. It can be turned off, you can leave only the last restore point in the "Extra" tab on the "Extra disk" tab to save space.

About the winsxs folder , the developers wrote a whole article saying that this is the main OS repository, and all other system files are like hardlinks, blah blah blah ... and yes, accept as a gift from God that with time folder size will only increase.

1. Preparation


Windows Vista Business 32-bit.
First, I found out the size of the winsxs folder is about 4.5 gigs.
Further, all important and recommended updates were installed methodically as of October 8, 2009, including SP1 and SP2. After all the procedures were completed, I downloaded a wonderful Scanner to assess the magnitude of the disaster.

Installing updates has transformed the Windows folder.
image

Now in order:
- vsp1cln.exe;
- compcln.exe - worked for about five minutes.

After that, I do a restore checkpoint (you never know what), get rid of the previous ones, and move on to the most important stage for today.

2. Winsxslite


This is not even a program - it is a .bat file that reduces the size of the winsxs folder. It is written by a certain Christian Bering Boegh and is distributed “as is”, which personally caused some suspicions in me that could only be dispelled by a successfully completed script. Under the link you can find the latest version of the script (1.86) with the author's comments.

The script includes two phases:
1. Search in the Program Files and Windows folders of files identical to the files in winsxs.
2. Replacing old versions of a file in winsxs with hard links to newer versions of a file.

You can work with the online system (that is, with a working OS) and with the OS image.
Working with the online system looks like this:
- Phase 1 scan;
- Phase 1 apply;
- Reboot;
- Phase 2 scan;
- Phase 2 apply;
- Reboot.

image

A reboot is needed because some files do not have access to change and the script creates a TODOlist, the data from which is taken after a reboot.

The script also uses the configuration file config.txt, which contains exceptions for the first phase (logs, temp, cache, etc.), and language priorities for the second phase (unused localization files are replaced with hardlinks of the corresponding files of other languages), “da-dk = KEEP” is entered into the default configuration, which changes to the necessary line ru-ru = KEEP, uk-ua = KEEP or another necessary.

Winsxslite will only work with the following software:
- SubInACL v5.2.3790.1180;
- PendMoves v1.1 and MoveFile v1.0 ;
- Ln - Command Line Hardlinks;
- Fcmp v1.6 - the author recommends using exactly 1.6;
- MD5File ;
- StringConverter v1.2 .

I installed all installed files in a folder with winsxslite. If someone is bored with performing all the procedures himself, here is the link . There actually winsxslite, all necessary software plus a config with the corrected da-dk. Config can be deleted. When you first start winsxslite, a default config and help file will be created.

3. Results


image

Looking at the results, I realized that I had made a strategic mistake - I took a laptop for the test, which was hardly used at work. That is, the OS age was at most a couple of days, virtually nobody worked at a laptop. On the home computer, the results were more tangible. There, the winsxs folder lost 8 gigs, but up to the same 14.8.

The author writes that the explorer does not give out the real size of this folder, and in its utility you can find out the true size.

Be that as it may, both patients did not suffer, and winsxslite proved to be an excellent tool in reducing the volume of insatiable Windows.

In conclusion, I would like to note that both phases of the script can take from one to two computer hours.

PS Article about the use of disk space in Win7. No third-party programs for castration of the system (such as vLite) were used.

Source: https://habr.com/ru/post/72427/


All Articles