WMP has disc space gobbling graficcache

Probably this is something off-topic but it has to do with digital music libraries.
We've got a zoo of various PCs, a fair number of them with Windows 7.
The default settings for WMP in W7 are that it looks around the network to see if someone shares his music. Then WMP goes and fetches the jpgs from this PC and stores them locally in this folder

C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\Media Player\grafikcache/localMLS.

But WMP never deletes any files in this folders. So it grows and grows.
We now had the phenomenon of disc drives (of course the ones with the OS on it) which inexplicably filled up.
The compromising data was stored in that folder named above.
We had one folder with more than 1 Mio files in it, others that had half a million. One drive had some 160 GB of files only in this folder.
In the end it takes literally HOURS to delete these superfluous files.
Do not use the explorer to navigate to that path but a command shell with administrator rights because the explorer will look like crashed.
Do not be tempted to have the file list displayed (with the "dir" command) as it will freeze your PC for hours.
Once you have navigated to that path use the command
del /ah *.jpg
and wait.
It will take a LOOOOOOOONG time to clean the directory.
The benefit will be gigabytes of freed disc space.
This was not a fairy tale.
Have look at your drive. you will be amazed.

I think you can hinder WMP to gobble your disc space by telling it only look at your local files but not to peak into other people's drives.

Never heard of this WMP acquisitiveness ... but I do understand your fight.
Use the RD /S /Q command to remove the entire folder, it works faster than the DEL command.

DD.20100603.2044.CEST

we tried to remove the folder but as the files are hidden (del /ah) the rd command stops and claims that the folder is not empty.
Trying the same with UBUNTU did not help and led to similar reaction times.
So far we had two badly hit teenie PCs with more than 50 GB of files in it and even an ordinary PC hat some 300000 files in that folder.
Amazing.

I see no problem with RD /S even on folder and files which have set attributes AHRS.
If the folder rejects removing, then possibly some application locks it.

DD.20100603.2101.CEST

In the end the result will be the same.
i just tried rd /s (you see the process is still running) and watch the free disk space at the same time in the explorer.
A rough estimate tells me that rd /s is not very much quicker as the disk space increases by something like 100 MB every half minute - and this about the same time it took with the del /ah command.
But anyway: I am glad that I found the reason for the filling up drives and that there is also a remedy.
Thanks for sympathizing with my problem and the constructive help.

You should not do that, possibly the Windows Explorer is the brake.

Some time ago I did a profiling test between DEL and RD:
Deleting 110.000 Files, 31.726.401 Bytes, in one folder, no subfolders.

CMD.EXE /C DEL /S /Q /F "W:\FILETEST1*.*" >NUL: 2>&1 && RD "W:\FILETEST1" >NUL: 2>&1
(92.750 ticks, 100.00 pct)

CMD.EXE /C RD /S /Q "W:\FILETEST2" >NUL: 2>&1
(81.375 ticks, 87.74 pct)

There was a significant better performance when using the RD command.

Still the fastest method to get rid of millions of files is ... to format the partition ... but not practicable in some cases.

DD.20100603.2157.CEST

... Still the fastest method to get rid of millions of files is ... to format the partition ...

Yeah, I was close to do that. BUT it is the OS partition in a worn Windows with loads of applications and registrations and stuff.
And reconfiguring those would have taken probably just as long as using the way of deleting individual folders.
The rd /s command has now freed another 6 GB - but I fear that further 50 are waiting for treatment.