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?


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.

  • Still had to run this in a Command Window with Administrative privileges so not sure if it is any better.
    – radimpe
    Nov 11 '14 at 8:07

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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