我为客户创建了一个批处理文件来创建项目目录
我必须在为wexample“A001 test project”创建根文件夹时添加引号然后创建我想要的所有目录。
说到ICACLS,它失败了,因为它不需要围绕%dname%
的“”如何删除仅适用于此部分的报价,以便ICACLS可以正常工作。
下面的批处理文件代码;
color 9f
@ECHO OFF
CLS
ECHO Directory Creator Tool
ECHO.
ECHO Any errors please report to Me
ECHO.
ECHO Type below the name of the new project
ECHO.
ECHO.
ECHO PLEASE REMEMBER TO ADD COMMAS "BEFORE AND AFTER THE PROJECT NAME"
ECHO.
ECHO.
ECHO Example... Enter Project Name? "A001, Test Project"
ECHO.
ECHO.
ECHO.
set /p dname= Enter Project Name?
mkdir P:\%dname%
mkdir P:\%dname%\Communications
mkdir P:\%dname%\Communications\"Base Information"
mkdir P:\%dname%\Communications\"Base Information"\Authorities
mkdir P:\%dname%\Communications\"Base Information"\Authorities\Superseded
mkdir P:\%dname%\Communications\"Base Information"\Drainage
mkdir P:\%dname%\Communications\"Base Information"\Drainage\Superseded
mkdir P:\%dname%\Communications\"Base Information"\Layout-Masterplan
mkdir P:\%dname%\Communications\"Base Information"\Layout-Masterplan\Superseded
mkdir P:\%dname%\Communications\"Base Information"\"OS Data"
mkdir P:\%dname%\Communications\"Base Information"\"OS Data"\Superseded
mkdir P:\%dname%\Communications\"Base Information"\Planning
mkdir P:\%dname%\Communications\"Base Information"\Planning\Superseded
mkdir P:\%dname%\Communications\"Base Information"\"Topo Survey"
mkdir P:\%dname%\Communications\"Base Information"\"Topo Survey"\Superseded
mkdir P:\%dname%\Communications\"Base Information"\Utilities
mkdir P:\%dname%\Communications\"Base Information"\Utilities\Superseded
mkdir P:\%dname%\Communications\"Base Information"\"Working Dwgs"
mkdir P:\%dname%\Communications\"Base Information"\"Working Dwgs"\SuperSeded
mkdir P:\%dname%\Communications\Correspondance
mkdir P:\%dname%\Communications\Correspondance\"Emailed Sketches"
mkdir P:\%dname%\Deliverables
mkdir P:\%dname%\Deliverables\Drawings
mkdir P:\%dname%\Deliverables\Drawings\"Base Xrefs"
mkdir P:\%dname%\Deliverables\Drawings\"Base Xrefs"\Superseded
mkdir P:\%dname%\Deliverables\Drawings\"Digital Copies"
mkdir P:\%dname%\Deliverables\Drawings\"Digital Copies"\Superseded
mkdir P:\%dname%\Deliverables\Drawings\Superseded
mkdir P:\%dname%\Deliverables\"Micro Drainage"
mkdir P:\%dname%\Deliverables\"Micro Drainage"\Superseded
mkdir P:\%dname%\Deliverables\"Micro Drainage"\"Working Input-Output Files"
mkdir P:\%dname%\Deliverables\PDS
mkdir P:\%dname%\Deliverables\PDS\"Working Input-Output Files"
mkdir P:\%dname%\Deliverables\Reports
mkdir P:\%dname%\Deliverables\Reports\Superseded
mkdir P:\%dname%\"Project Management"
mkdir P:\%dname%\"Project Management"\"CDM,H&S"
mkdir P:\%dname%\"Project Management"\Contract
mkdir P:\%dname%\"Project Management"\Financial
mkdir P:\%dname%\"Project Management"\Programme
mkdir P:\%dname%\"Project Management"\Proposal
mkdir P:\%dname%\"Project Management"\QM
mkdir P:\%dname%\"Project Management"\Financial\"Cost Tracking"
mkdir P:\%dname%\"Project Management"\Financial\Invoices
xcopy P:\Templates\"BLANK Designers Risk Assessment DRA 01.docx" P:\%dname%\"Project Management"\"CDM,H&S"\
xcopy P:\Templates\"BLANK Designers Risk Assessment DRA 02.docx" P:\%dname%\"Project Management"\"CDM,H&S"\
xcopy P:\Templates\"BLANK Site Risk Assessment Method Statement.docx" P:\%dname%\"Project Management"\"CDM,H&S"\
xcopy P:\Templates\"QM Form 904 Project Issue Register v2.docx" P:\%dname%\"Project Management"\QM
set /p dname= Enter Project Name?
ICACLS "P:\%dname%" /inheritance:r
ICACLS "P:\%dname%" /grant:r JPITS05\Admin:(OI)(CI)(F)
ICACLS "P:\%dname%" /grant:r ALPCE:(OI)(CI)(F)
ICACLS "P:\%dname%" /grant:r ALPCEusers:(OI)(CI)(R)
icacls "P:\%dname%\Communications\Base Information" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Communications\Correspondance" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Deliverables\Drawings" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Deliverables\Micro Drainage" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Deliverables\PDS" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Deliverables\Reports" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\CDM,H&S" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\Contract" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\Financial" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\Programme" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\Proposal" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\QM" /grant:r ALPCEusers:(OI)(CI)(F)" /grant:r ALPCEusers:(OI)(CI)(F)
icacls "P:\%dname%\Project Management\Financial\Invoices" /grant:r ALPCEusers:(OI)(CI)(F)
ECHO Complete
Pause
exit