How to combine wildcards and spaces (quotes) in an Windows command?
- by Jan Fabry
I want to remove directories of the following format:
C:\Program Files\FogBugz\Plugins\cache\[email protected]_NN
NN is a number, so I want to use a wildcard (this is part of a post-build step in Visual Studio). The problem is that I need to combine quotes around the path name (for the space in Program Files) with a wildcard to match the end of the path. I already found out that rd is the remove command that accepts wildcards, but where do I put the quotes? I have tried no ending quote (works for dir), ...example.com*", ...example.com"*, ...example.com_??", ...cache\"[email protected]*, ...cache"\[email protected]*, but none of them work.
(How many commands to remove a file/directory are there in Windows anyway? And why do they all differ in capabilities?)