Link to home
Start Free TrialLog in
Avatar of Osley
Osley

asked on

Batch folder creation?

I need to modify a DOS script, so that it:

1. creates one folder called 'documents' and within this folder, 3 more folders, where there's 400 folders that this needs to be applied to
2. count of how many folders the function was applied to
3. create a log file confirming success/ failure

I was previously provided the following script under the address:

https://www.experts-exchange.com/questions/28006593/Batch-folder-creation.html

How do I modify this, to achieve the above?

@echo off
setlocal
set BaseDir=H:\Temp Folder\2013
set NewDirs="Excel","Powerpoint","Word"
(
  echo Making Directories...
  for /D %%A in ("%BaseDir%\*.*") do (
    for %%B in (%NewDirs%) do (
      md "%%~A\%%~B" >NUL 2>&1 && (
        echo Created: "%%~A\%%~B"
      ) || (
        echo *ERROR*: "%%~A\%%~B"
      )
    )
  )
)>"log.txt"
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Osley
Osley

ASKER

Awesome. Thanks. That did it very well.

Once again - much appreciated.
Happy to help, thanks for the feedback.

~bp