Files piling up in C:\ProgramData\Microsoft\Crypto\RSA\S-1-5-18

article #1100, updated 2636 days ago

When certain antivirus products go a bit haywire, or other unfortunate things happen, hundreds of thousands of small files can pile up in either the location in the title of this article, or here:

C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys

The location in the title seems to be more common in Windows 10, the other more for Windows 7, but check both, and if you have a pileup in either, run this CMD command inside:

forfiles /D -10 /C "cmd /C attrib -s @file & echo @file & del @file"

forfiles is a very nice command that iterates through the files in a folder according to its parameters. /D -10 iterates through all files more than 10 days old. attrib -s takes off the System attribute, which is needed for DEL (delete) to work. The echo is there so you can see that it is doing its job.

Categories: