This article is all about the C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files folder on your MOSS systems…..
I was alerted by one of my systems this morning that I am running out of diskspace on the systemdrive. After running my favourite tool for this kind of situations, TreeSizeFree.exe, I discovered it was hanging while enumerating a sub-sub-sub…. folder of the Temporary ASP.Net Files folder. Don’t you hate it when a tool you have always relied on hangs like that? Well, I do. Of course copy/paste the path into a cmd window and runing the dir command showed me what was wrong. After endless enumeration of that particular folder I discovered that there were 182000 (that is One hundred and eighty two THOUSAND) files in the folder. No wonder my tool hanged a while. So what’s next? How will I clean this up. Here are the commands I used to cleanup that mess:
1. Stop IIS
2. cleanup the folder(s).
The problem here is that there are a lot of subfolders in there that need to be cleared as well, so you have two options:
A. using the rd command in combination with a for statement:
for /d %i in (“%systemroot%\Microsoft.Net\Framework64\v2.0.50727\Temporary ASP.NET Files\*”) do RD /q/s %i
B. using robocopy. Just create an empty folder in some place and them run robocopy with /MIR. For example:
robocopy %TEMP%\empty “%systemroot%\Microsoft.Net\Framework64\v2.0.50727\Temporary ASP.NET Files” /MIR
(Found this trick on a comment on a blog article of Doug Steward who actually wrote another way to do it)
3. Finally restart IIS
Some of you might prefer to reboot the system because IIS is down anyway at this time.
So hope this helps you out somehow if you discover a lot of files in there