Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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 at 19:52

Your Answer

 
discard

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.