Delete ASP temporary internet files

Asked By 0 points N/A Posted on -
qa-featured

Is there any tool that will programmatically delete ASP temporary internet files?

For manual deletion, we must drill down to subfolders and delete their contents before deleting it in the root folder.

It is time consuming for deleting the files each time, please advice on how to overcome this issue with a tool.

SHARE
Best Answer by Sharon D Mickelson
Answered By 0 points N/A #189328

Delete ASP temporary internet files

qa-featured

If you happen to be using IIS 6 or later you could modify this power shell script and make it to stop and start so that it carries out the deletion.

param([string]$appPoolName, [switch]$stop)
 
$appPool = get-wmiobject -namespace "rootMicrosoftIISv2" -class "IIsApplicationPool" | where-object {$_.Name -eq "W3SVC/AppPools/$appPoolName"}
 
if($appPool)
{
   if($stop)
   {
      $appPool.Stop()
   }
   else
   {
      $appPool.Start()
   }
}

I hope this helps.

 

Best Answer
Best Answer
Answered By 10 points N/A #189329

Delete ASP temporary internet files

qa-featured

First of all, I did not understand why you should delete the ASP.NET temporary files. ASP.NET runtime engine efficiently handles deletion of temporary files in most cases.

Even in the worst case you think of deleting the content in the folder, you can write a simple batch file with the following command 
 
del C:~Folder location~*.*
 
If want to run it at specified intervals, you can schedule execution of this batch file using Windows scheduler.
 
Hope this solves your problem easily!

Login/Register to Answer

Related Questions