I want to delete every "_svn" in every folder and subfolder...
For example
c:\ proyect1 _svn images _svn banner _svn buttons _svn
Then I run something like
rm-recurse c:\proyect1 _svn
And I should get:
c:\ proyect1 images banner buttons
The ideal thing would be a tiny stand-alone EXE or something like that.
--
Thanks Grant, as soon as I posted the question I saw SVN documentation about the SVN export command, but I also want to delete the _vti_* folders stuff Visual Studio creates, so I'll also explore the for
solution.
To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.
rmdir “C:\Users\username\Desktop\Info” If you want to delete all the files and subfolders in the folder you want to delete, add the /s parameter. This will ensure that the folder is removed including the subfolders and files in it.
To delete folders (also called directories) on your PC, use Windows' built-in rmdir command. This command helps you delete folders as well as their subfolders and the files inside them. Warning: Know that the rmdir command removes folders without moving them to the Recycle Bin.
Similar to BlackTigerX's "for", I was going to suggest
for /d /r . %d in (_svn) do @if exist "%d" rd /s/q "%d"
Time to learn some PowerShell ;o)
Get-ChildItem -path c:\projet -Include '_svn' -Recurse -force | Remove-Item -force -Recurse
The first part finds each _svn folder recursively. Force is used to find hidden folders. Second part is used to delete these folders and their contents. Remove commandlet comes with a handy "whatif" parameter which allows to preview what will be done.
PowerShell is available for Windows XP and Windows Vista. It is present on Windows 7 and on Windows Server 2008 R2 by default.
It's a MS product, it's free, and it rocks!
For inclusion/invocation from within a BATCH file use (say for removing Debug and Release folder):
for /d /r . %%d in (Debug Release) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"
double %
are required within a batch file to work as escape chars. Else it reports error of syntax.
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With