Question: There is a known issue with SVN repositories and the windows indexing service fighting over .svn metadata files. [Here for more details.](http://schleichermann.wordpress.com/2009/12/09/svn-tortoisesvn-cant-move-the-file-or-directory-is-corrupted-and-unreadable-windows-7/)

How can we set it up so there are **automatically** no problems having subversion repositories indexed by windows (Vista/Win7). *(We don't want to have to manually do something every time we add repo directory.)*

One idea is to setup Windows to automatically not index folders named ".svn", however I can not find a way to do this.

I know you can disable certain extensions, but that doesn't seem to work since the svn metadata files are in a folder.

Note: The

Answer: 
The obvious fix would be to change Subversion to set this "don't index" flag whenever it creates a .svn directory. The problem is that this feature will be no longer needed when it's introduced.

The known problem will most likely go away in the Subversion versions that's currently being developed (version 1.7). There will be far less file operations inside the .svn directory, and also just 1 .svn directory per working copy.

This makes it less likely that the problem will occur, and also makes it far easier to disable indexing, because there's just a single .svn folder.
If Darren Halls answer is the "Brute Force" approach, then my answer has to be the "Brute Force and Ignorance" approach. :)

This is something that has recently annoyed me as we use SVN for document and project management which can mean the Windows indexer is very useful when it comes to being able to search for obscure documents, but it catching all the svn storage files is just useless.

This is my (rather ugly) solution in a windows batch file:

```
 ATTRIB /S /D -H ".svn"

 ATTRIB /S /D +I ".svn"
 ATTRIB /S /D +I "all-wcprops"
 ATTRIB /S /D +I "entries"
 ATTRIB /S /D +I "tmp"
 ATTRIB /S /D +I "props"
 ATTRIB /S /D +I "text-base"
 ATTRIB /S /D +I "prop-base"
 ATTRIB /S /D +I "*.svn-base"

 ATTRIB /S /D +H ".svn"

```

The first and last lines are there because ATTRIB refuses to apply the +I switch to a hidden folder, at least it did for me. You'll need to copy this to a file like "svnNoIndex.bat" and run it in your SVN checkout directory, with a large repository it could take some time...

I'm currently testing this under Vista with the latest service pack, I would expect it to work on Windows 7. I don't know if the index needs to be rebuilt to take account of the files which are now marked as not indexed by doing this, but I need to rebuild mine anyway so that's what I'm doing as it's only a few days while the index rebuilds.

In order to make this "automatic" you could add the batch file as a post-update hook that gets run after an update... granted it is messy, but it might work.