After having spent some time using WEBDAV on one of my Windows 7 computers, I have discovered that my system drive (C:) was filling up quite quickly. After deep investigation I have discovered that any file downloaded or uploaded from/to a network drive mapped with WEBDAV gets copied to a cache on the local system. The location for this local cache is always "c:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\TfsStore\Tfs_DAV" in Windows 7.
Unfortunately I wasn't able to find the meaning of that 'tfs' acronym in this context, nor I have succeeded in disabling this behavior. What I have understood so far is that:
- Files from this folder never get deleted (unless you do it manually)
- You can't disable it
- You can't change its location (unless you create a symbolic link)
- There is no registry key specifying its behavior
- You can delete this Tfs_DAV folder
- If you delete Tfs_DAV you will be able to browse WEBDAV drives
- If you delete Tfs_DAV you will be able to right-click on a field and get its properties
- If you delete Tfs_DAV you won't be able to open any file, not even text documents
Technically speaking, when you delete that Tfs_DAV folder, the svchost.exe process (started with this commandline: C:\Windows\system32\svchost.exe -k WebClientGroup) will try to get to "C:\Windows\SERVIC~2\LOCALS~1\AppData\Local\Temp\TfsStore\Tfs_DAV" with an IRP_MJ_CREATE operation and gets PATH NOT FOUND as result.
A solution to this problem of the system drive getting filled up with cached copies of network files is to move the Tfs_DAV folder to a different drive.
Here's my batch script to do it:
e: mkdir Tfs_DAV c: cd "c:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\TfsStore\" del Tfs_DAV /f /q mklink Tfs_DAV e:\Tfs_DAV
If the delete command fails, just delete Tfs_DAV from Windows Explorer then rerun this script.
If the procedure succeeds, you will get an output like this:
symbolic link created for Tfs_DAV <<===>> e:\Tfs_DAV
This is the best I could do for the moment. I will keep investigating the internals of WEBDAV (such as the functioning of the redirectors mrxdav.sys, rdbss.sys and MUP) and will keep this post up-to-date as soon as I find a better workaround than moving Tfs_DAV to another drive.
If you feel like contributing to this post do not hesitate to share your knowledge or experience!