HOWTO quickly rename folders from _svn to .svn

Once upon a time, someone had the idea to use β€˜_svn’ for a Windows SVN sandbox working folder instead of the standard β€˜.svn’.

I suppose, that the idea was to use a more windows-aligned folder name.

By using TortoiseSVN, it was quite transparent.

Years passed, and the idea was dropped, and these sandboxes aren’t working anymore by default.
TortoiseSVN still provides a hidden registry setting to support them.

Honestly I don’t like the idea to edit the registry for something that one day may be ripped away.

The solution

To fix them, you simply have to rename β€˜_svn’ folder to β€˜.svn’.

What can go wrong?

The main problem here is that you cannot use Explorer because it doesn’t accept β€˜.svn’ as a valid folder name.

At this point you need to do it by Command Prompt, maybe with a small script like the following one:

dotsvn1.cmd

cd %1
attrib -H "_svn"
ren "_svn" ".svn"
attrib +H ".svn"
cd ..

If you have to fix several sandboxes into a folder, you can write down, a similar script like this one, to convert them all.

dotsvn.cmd

for /D %%i in (*) do call dotsvn1.cmd "%%i"