On any folders that have an & character in the folder name, the above (or below?) command seems to stop reading the name at that symbol. For example, I have a folder called "A & A businees, inc." When I run the forfiles command, the resultant command only shows "md c:\test\A " instead of md "c:\test\"A & A businees, inc."\TY08\Tax Returns"
It drops the & symbol and the rest of the name. Ideas on how to overcome this? I included the slashes so that I could get it to make folders with a space in the name - however, I'm not getting any folders with & in the name now.
Here's the catch: If I run the second command included, the resultant command has the path correct (but isn't creating the directory as I wanted with a space. I had to include the underscore.
1. forfiles /p c:\test /c "cmd /c if @isdir==TRUE md \"@path\TY08\Tax Returns\""
2. forfiles /p p:\ /c "cmd /c if @isdir==TRUE echo md @path\TY08\Tax_returns" > c:\fileorig.txt