We have a Windows Server 2008 machine running as a web server.
We noticed a problem with one of our PHP based websites today, and the error message related to the session and access to the Windows Temp folder.
When I logged into the server and tried to open the Temp folder in explorer it was taking a very long time. The files count was going up and up, and I closed it when it reached 220,000 files (and was still counting).
I tried to use CMD, but that hung when I did cd temp
, so presumably it was counting files too.
So... I need a way to delete the entire contents of the Windows Temp folder, without having to open the folder up first.
I've installed disk cleanup, but that's just sitting there trying to calculate the space, so I guess it's counting files too.
I'm guessing that event viewer has something to do with this problem, because I can't open it (it's just sitting there saying "adding snap-in to console").
I've found the following: del %TEMP%\*.* /f /s /q
...which I could add to a .bat
file.
Is that ok to try..? Or is there a better way..?