First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

A few years ago I wrote a post that showed how to write a NAnt script to clean a folder structure from the artifact’s folders used by Visual Studio.

Today what I wanted to show you is a way that doesn’t require NAnt installed on your computer, but that uses just a very simple command for Windows’ shell.

Actually, it’s just a very tiny variation of the same command that Jon Galloway wrote to clean a folder structure from SVN files.

But without further ado, here it is:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN] @="Delete SVN Folders"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteBinObj]
@="Delete Visual Studio Artifact Folders"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteBinObj\command]
@="cmd.exe /c \"TITLE Removing BIN and OBJ Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (bin obj) DO RD /s /q \"%%f\" \""

To install it, all you have to do is copy the text above into a txt file, rename it to .reg and double click on it. And after that you will have two new commands that will appear in the right-click menu in Windows Explorer.

Menu

HTH

Technorati Tags: ,
posted on Tuesday, March 16, 2010 10:34 PM

Comments on this entry:

# re: Cleaning up a folder structure from Visual Studio artifacts from the shell

Left by Trebor at 3/16/2010 11:54 PM

I think "Delete Visual Studio artifacts" is a bit misleading, considering that it also deletes the .svn folder. If I understand the command correctly?

Great script though! thanks!

# re: Cleaning up a folder structure from Visual Studio artifacts from the shell

Left by Simone at 3/17/2010 1:21 AM

Sorry Trevor, my bad... left a wrong version of the command.. now it's fixed

# re: Cleaning up a folder structure from Visual Studio artifacts from the shell

Left by Adrian at 5/23/2010 7:18 AM

Great script!

Just wanted to point out that SVN has an Export command that will copy version-controlled files to a new directory without the svn stuff.

Also, TortoiseSVN provides several ways to perform the export, including one that will copy all files, even non-version-controlled ones, to the new directory: the right-click drag method, described in detail here.

Comments have been closed on this topic.