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

How do I delete all symlinks and only all symlinks from a folder with a batch file/script?

The folder is c:\wamp\www, and this is what I've tried:

Content files delete.cmd

for /f "delims=" %%D in ("dir /a:l /s /b c:\wamp\www") do (
rmdir c:\wamp\www\%%D

But my code does not work.

share|improve this question

For deleting symlinks to files you want to use del

In order to delete symlinks to directories, you would use rmdir

share|improve this answer
symlinks the directories ... – Z55 Apr 24 '14 at 19:52

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.