问题描述:

for /F "tokens=*" %* in (C:\Test.txt) do (md "C:\TEMP\%*" || cd "C:\TEMP\%*" || md "Computer" || md "Email")

With this command I can create the one folder per name in test.txt but it won't let me create the subfolders.

Ideally it would create folder Smith then every folder would get two identical subfolders Car and House.

Thanks for any help.

网友答案:

Very impressive usage of batch script. :-) It has been long since I last saw someone writing .bat script. Would you try:

for /F "tokens=*" %x in (C:\Test.txt) do mkdir c:\temp\%x\Computer c:\temp\%x\Email
  • mkdir accepts multiple directory names.
  • you must do "cd .." if you do "cd C:\temp" at first. but cd is not necessary at all.
相关阅读:
Top