The company I work for has created a folder for each of the clients we have (folder name = client name). Recently in a staff meeting we decided that to standardize on organization, the client folders (350 of them already there) should all have 7 standard subfolders within each one, for example- Contracts, Correspondence, Projects, etc. Creating these 7 subfolders inside any NEW client folders is easy, but we want to know if there is a way to auto-create these 7 standard subfolders inside the 350 existing client folders, so someone doesn’t have to break their arm off trying to do it manually.
Many of these client folder names have commas and spaces, which has been throwing off attempts trying to use the FOR command.
Any suggestions?
replicating a set of subfolders
Moderator: DosItHelp
-
- Posts: 1
- Joined: 11 Sep 2009 12:02
- Location: Delaware, USA
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
**UNTESTED**
Code: Select all
@echo off
set "parentdir=f:\clients"
set folders="pleadings" "correspondence" "misc and other" "briefs" "templates" "final" "pending"
cd /d "%parentfolder%"
for /d %%a in (*) do (
for /f %%b in (%folders%) do md "%%~a\%%~b" >nul 2>nul
)