Help with MS-DOS Syntax for Using Quotation Marks Within Quotation Marks
Posted on 2008-10-17
I'm trying to create a host of folders in one of our network drives at our firm. I've discovered and have studied the use of forfiles.exe, and almost have what I need. The following command is very close to accomplishing my task:
forfiles /p c:\test /c "cmd /c if @isdir==TRUE md @PATH\TY08\Tax_Returns"
It will create a subdirectory for every folder in c:\test named TY08, and also creates a folder in TY08 called Tax_Returns. I've only included the underscore because I can't get it to use a space. I'm aware that I would normally use a command like md @path\TY08\"Tax Returns" with the quotations and it would spit out the right new folder name. But since I have to have quotations around the entire command section, how can I imbed a second layer of quotations that MS-DOS will read? I've tried this to no avail:
forfiles /p c:\test /c "cmd /c if @isdir==TRUE md @PATH\TY08\""Tax Returns"""
Ideas appreciated. Is there a better way to put together a batch file command to create subdirectories?