Sunday, January 4, 2015

windows - Batch file to compress WinSxS files that haven't been used in a while

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)?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...