0

For a project I received 700 folders with names of institutions (containing spaces). The purpose is now to create subfolders in each of these folders.

[institution folder]\Documents\ [institution folder]\Images\ [institution folder]\Videos\

According some posts here the below script should work to create the Documents folder

FOR /d %A IN (C:\Users\myname\project\institutions\*) DO mkdir %A\Documents

However, I notice in the feedback that I get from the command line that this instruction fails at the spaces in the foldername. How can I get this to work?

Gigi2m02
  • 1,238
  • 3
  • 17
  • 33

2 Answers2

3
FOR /d %A IN (C:\Users\myname\project\institutions\*) DO mkdir "%A"\Documents

should do the trick.

Magoo
  • 77,302
  • 8
  • 62
  • 84
2

make sure you wrap expressions containing spaces with " to make sure the shell sees them as a single entity.

Gung Foo
  • 13,392
  • 5
  • 31
  • 39