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
- Open taskschd.msc and browse to \Microsoft\Windows\Servicing\
- Double click StartComponentCleanup
- Delete the Custom Handler in the Actions tab
- 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\
- Open a Elevated (Administrator) Command Prompt
- Browse to the base folder you want decompressed (ex: Windows\WinSxS)
- Type "Compact /U /S /A /I /Q" and wait for it to finish
- Type "PSExec -hsi cmd"
- Browse to the base folder you want decompressed
- Type "Compact /U /S /A /I /Q" and wait for it to finish
- Type "Exit"
- Type "net start TrustedInstaller"
- Type "runassystem_x64.exe "runfromtoken_x64.exe trustedinstaller.exe 1 cmd""
- Browse to the base folder you want decompressed
- Type "Compact /U /S /A /I /Q" and wait for it to finish
- Type "Exit"
- 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