Moving on from SVN_ASP_DOT_NET_HACK

I noticed that I was running TortoiseSVN in SVN_ASP_DOT_NET_HACK mode (where Subversion clients use ‘_svn’ instead of ‘.svn’ directories) unnecessarily as I don’t have silly old Visual Studio 2003 installed anymore which caused this mess in the first place.

The _svn directories work just as well as .svn, but nevertheless (due to mild OCD?), I created a batch script that ripped through my project directory renaming all ‘_svn’ directories to ‘.svn’, so I could remove the SVN_ASP_DOT_NET_HACK mode. It uses the wonderfully flexible FOR command drive the whole process. We don’t need no stinkin’ Powershell round these parts…

Save this script as something like “SvnRenameDirs.cmd” in the root of your projects folder:

:: Make script directory current
pushd "%~dp0"

:: Unhide, rename and re-hide svn dirs
for /r /d %%D in (*) do @if exist "%%D\_svn" (
   attrib -H "%%D\_svn" 
   ren "%%D\_svn" ".svn" 
   attrib +H "%%D\.svn"

rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,0,3 

At the end click the Environment Variables button in the System Properties dialog and remove the SVN_ASP_DOT_NET_HACK environment variable and then log out and back in again (or restart explorer.exe and TSVNCache.exe).

4 Responses to Moving on from SVN_ASP_DOT_NET_HACK

  1. Jakob says:

    Thank you for sharing the script. Since I switched to use both Windows and Linux I am having trouble getting SVN work under Linux cause of the ASP-hack. I will try out your script, cause recompiling the SVN-client under Linux to make it fit the “_svn” -standard is no real option…

  2. Pingback: Setting up Subversion on Windows « Zakaria Bin Abdur Rouf

  3. Pingback: Setting up Subversion on Windows « Sochinda's Blog

  4. Super helpful script. Thanks a lot for sharing!


Get every new post delivered to your Inbox.

Join 41 other followers

%d bloggers like this: