)
In order to make the company (where I'm working) operate more organized and efficiently we've created an approved folder structure for new projects.
New projects and Live projects reside on a file server and are at the same level as each other. (Live projects have made it through planning, new projects sometimes only go as far as planning)
The project folder structure can be a meticulous to create each time we start a new project, therefore I made a windows batch file to create it. You can find it here: http://pastebin.com/mnSu5vnk This part works well!
The folder structure is:
F:\New Job\Project Name\Project Correspondence
F:\New Job\Project Name\Project Directory
F:\New Job\Project Name\Project Drawings
F:\New Job\Project Name\Project Images
F:\New Job\Project Name\Project Correspondence\Arboriculturalist
F:\New Job\Project Name\Project Correspondence\CGI
F:\New Job\Project Name\Project Correspondence\Client
F:\New Job\Project Name\Project Correspondence\Measured Survey
F:\New Job\Project Name\Project Correspondence\Planning
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)
F:\New Job\Project Name\Project Correspondence\Client\Appointments
F:\New Job\Project Name\Project Correspondence\Client\Fees
F:\New Job\Project Name\Project Correspondence\Planning\LA Planning
F:\New Job\Project Name\Project Correspondence\Planning\Planning Consultants
F:\New Job\Project Name\Project Correspondence\Planning\LA Planning\Planning Application
F:\New Job\Project Name\Project Correspondence\Planning\LA Planning\Pre Application
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\Arboriculturalist
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\Contract Administrator
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\Contractor
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\LA Building Control
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\M&E Consultants
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\Structural Engineer
F:\New Job\Project Name\Project Correspondence\Post Planning Folders (Drop in as and when)\Tender, Specification
F:\New Job\Project Name\Project Drawings\CD Series (Construction Details)
F:\New Job\Project Name\Project Drawings\Drawing Register
F:\New Job\Project Name\Project Drawings\EW Series (External Works)
F:\New Job\Project Name\Project Drawings\Outgoing Drawings
F:\New Job\Project Name\Project Drawings\P Series (Planning)
F:\New Job\Project Name\Project Drawings\RL Drawings (Room Layouts)
F:\New Job\Project Name\Project Drawings\SK Series (Sketch Design)
F:\New Job\Project Name\Project Drawings\X Series (Existing)
F:\New Job\Project Name\Project Drawings\Outgoing Drawings\DWG FILES
F:\New Job\Project Name\Project Drawings\Outgoing Drawings\PDF FILES
The problem is that some new projects never make it to "Live" status; however, those that do get allocated a project number and consequently need prefixing each sub-folder with the project number. The reason for prefixing each sub-folder with the project number is owing to "people" accidentally dragging/copying/moving them off into the another project which can make things very confusing!
An additional problem is that some of the "new projects" have been sitting there for a while (1 year+) and have no folder structure to them, therefore I need to make a batch file that detects if the "new project" has the approved folder structure or not, and rename as appropriate.
This is what I currently have but I believe my methodology is all wrong.
@Echo off
:start
set /P ProjNo=Project Number:
set /P ProjAd=Project Address:
cls
Echo New Project Name?
Echo Project Number=%ProjNo%
Echo Project Address= %ProjAd%
set /p proceed=Is this correct? [Y/N]
if /i {%proceed%}=={y} (goto :yes)
if /i {%proceed%}=={yes} (goto :yes)
if /i {%proceed%}=={n} (goto :no)
if /i {%proceed%}=={no} (goto :no)
:no
cls
goto :start
:yes
set "currentpath=%cd%"
set "projfolder=%ProjNo%-%ProjAd%"
:: check if 000-Project Address doesn't exists
echo Does the Project folder exist %currentpath%\%ProjNo%-%ProjAd%?
If NOT exist "%currentpath%\%ProjNo%-%ProjAd%\"
(
echo the folder does NOT exist
::check if project folder name doesn't existing
if NOT exist "%currentpath%\%ProjAd%\"
(
:: rename the folder to 000-Project Address
echo Renaming Project Folder
ren "%ProjAd%" "%ProjNo%-%ProjAd%"
call:TopLevel
)
::if project address name DOES exist
else
(
::enter the folder and check the structure.
echo Project Folder doesn't need renaming
call:TopLevel
)
)
::-----------------------------------------------------
:: if "000-Project Address" DOES exist
::-----------------------------------------------------
else
(
Echo There is no need to run this script!
goto:eof
)
)
::-----------------------------------------------------
:: Recurse Top level
::
:: If all the "Recommended" directory names exist
:: rename all sub-directories too!
:: Else create them all!
::-----------------------------------------------------
:TopLevel
CD projfolder
::check if there's a project correspondence
IF exist "Project Correspondence"
(
ren "Project Correspondence" "%ProjNo%-Project Correspondence"
::rename the child folders
cd "%ProjNo%-Project Correspondence"
for /f "tokens=*" %G in ('dir /b /a:d "*"') do ren "%G" "%ProjNo%-%G"
cd "%ProjNo%-client"
for /f "tokens=*" %G in ('dir /b /a:d "*"') do ren "%G" "%ProjNo%-%G"
cd ..\planning\
)
else
(
mkdir "%ProjNo%-Project Correspondence"
callto:
::function makeProjCorrespondence
call:makeProjCorrespondence %ProjNo%
)
:: check if there's a project directory
IF exist "Project Directory"
(
ren "Project Directory" "%ProjNo%-Project Directory"
)
else
(
mkdir "%ProjNo%-Project Directory"
)
if exist "Project Drawings"
(
ren "Project Drawings" "%ProjNo%-Project Drawings"
::go to project drawings function
)
goto:eof
:makeProjCorrespondence
cd "%ProjNo%-Project Correspondence"
mkdir "%ProjNo%-Planning"
mkdir "%ProjNo%-Arboriculturalist"
mkdir "%ProjNo%-CGI"
mkdir "%ProjNo%-Client"
mkdir "%ProjNo%-Measured Survey"
mkdir "%ProjNo%-Post Planning Folders (Drop in as and when)"
::Make folders under Planning
cd "%ProjNo%-Planning"
mkdir "%ProjNo%-LA Planning"
mkdir "%ProjNo%-Planning Consultants"
cd "..\"
::Make folders in Client
cd "%ProjNo%-Client"
mkdir "%ProjNo%-Appointments"
mkdir "%ProjNo%-Fees"
cd "..\"
::make Post Planning folders
cd "%ProjNo%-Post Planning Folders (Drop in as and when)"
mkdir "%ProjNo%-Arboriculturalist"
mkdir "%ProjNo%-Contract Administrator"
mkdir "%ProjNo%-Contractor"
mkdir "%ProjNo%-LA Building Control"
mkdir "%ProjNo%-M&E Consultants"
mkdir "%ProjNo%-Structural Engineer"
mkdir "%ProjNo%-Tender, Specification"
cd "..\..\"
goto:TopLevel
Tips and advice would be much appreciated!
Many thanks