I'm trying to delete all .svn files from a folder and all of its subfolders so I'm doing this from the command line:

del /s *.svn

However, all I get is this for each .svn file:

Access is denied.

How do I make sure I can delete all of the .svn files?

link|improve this question

feedback

2 Answers

up vote 1 down vote accepted

I think what may be happening is that your del command isn't properly matching the ".svn" folder. I had the same problem and solved it using PowerShell like the following:

powershell.exe "Get-ChildItem .\foldername -include .svn -Recurse -Force | Remove-Item -Recurse -Force"

Using the above without the pipe to Remove-Item will show you the results without also deleting them.

link|improve this answer
feedback

You need to be a Administrator to do the following
Open up a command prompt window in the the directory that this folder (Quick way: shift+right click the current directory and click Open Command Prompt Here) then type takeown /f directory_name /r /d y where directory_name is the name of the directory with the *.svn files and then type icacls directory_name /grant administrators:F /t.

Now try deleting the files again, however you can also try del /f /s *.svn.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.