2

I plan to compress unused files in the WinSxS directory because the directory is too big.

To do so I enabled tracking of last file access time (fsutil behavior set disablelastaccess 0). I'll use the PC normally for a few days, but will also try to use every program I occasionally use. Then I want to enable NTFS compression for all files in WinSxS that haven't been accessed in the last month.

To do this manually I need to change the owner, then grant permission to modify, then set compression attribute.

Does someone already have a reliable batch script that does this (going through files in C:/Windows/WinSxS/**/* last accessed before date, change permissions, and set compression attribute)?

Peter
  • 4,630

1 Answers1

2

Windows 8 already includes compression of unused files if you have the latest Servicing Stackup installed. Open a command prompt as admin and run this command:

dism.exe /online /cleanup-image /startcomponentcleanup

This removes all replaced Updates and compresses the files which can't be removed in a diff file which reduces the size a lot:

enter image description here

As you can see the NTFS.sys files of the updates which can't be removed are dramatically smaller compared to the NTFS.sys which is used.