Friday, August 31, 2018

ntfs - Disable Windows 8.1 Component Store (WinSxS/DriverStore) automatic compression?



Windows 8.1 has a new Scheduled Task (Servicing\StartComponentCleanup) which will automatically delete or compress superseded and unused files from the Side by Side store, DriverStore and drivers folder.



I was wondering if anyone knows if it is possible to keep the component cleanup but skip the compression, all without disabling NTFS compression or the scheduled task?




Note that if some of the drivers/files start to be loaded/used Windows does not seem to uncompress them after they've been compressed. To uncompress them you have to manually run "compact /U" as the TrustedInstaller service.




Answer



After some experimentation in a VM it appears that running DISM with the added switch "/ResetBase" will not compress any files whilst still cleaning up superseded components. There is a catch however, running ResetBase will remove the ability to uninstall updates.




Full solution:





  • Edit the Component Cleanup Task


    1. Open taskschd.msc and browse to \Microsoft\Windows\Servicing\

    2. Double click StartComponentCleanup

    3. Delete the Custom Handler in the Actions tab

    4. Add a new action with "C:\Windows\System32\Dism.exe" as the Program and "/Online /Cleanup-Image /StartComponentCleanup /ResetBase" as the Arguments














  • Decompress \Windows\WinSxS\, \Windows\System32\drivers\ and \Windows\System32\DriverStore\



    1. Open a Elevated (Administrator) Command Prompt

    2. Browse to the base folder you want decompressed (ex: Windows\WinSxS)

    3. Type "Compact /U /S /A /I /Q" and wait for it to finish

    4. Type "PSExec -hsi cmd"

    5. Browse to the base folder you want decompressed

    6. Type "Compact /U /S /A /I /Q" and wait for it to finish

    7. Type "Exit"

    8. Type "net start TrustedInstaller"

    9. Type "runassystem_x64.exe "runfromtoken_x64.exe trustedinstaller.exe 1 cmd""


    10. Browse to the base folder you want decompressed

    11. Type "Compact /U /S /A /I /Q" and wait for it to finish

    12. Type "Exit"

    13. Type "net stop TrustedInstaller"




Note: Your running compact 3 times because of different ACL's on files (Once as a Administrator, Once as Local System and once as the
TrustedInstaller service.




No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...