Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have

  for /R "C:\path" %f in (_svn) do RMDIR /S /Q "%f" 

to remove the _svn folders from c:\path and this works if I paste it into the cmd window, but when run from a bat file it says f was not expected at this time.

Permissions? funk-a-tron? wassup?

share|improve this question
up vote 4 down vote accepted

you have to use %%f in .cmd / .bat files to make that work, see here:

Use %variable to carry out 'for' from the command prompt.
Use %%variable to carry out the 'for' command within a batch file
share|improve this answer
duh thanks. glad it was that easy. – Steve Aug 3 '11 at 4:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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