Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 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.

share|improve this answer
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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .