CMD批处理建文件夹与文件

大宝 4776 0

莱芜做手机网站的莱芜网站排名词速排为您服务,最近在研究Z-PHP框架,官网推荐的目录结构如下:

项目根目录

├─core 框架核心目录

├─common 公共程序文件目录

│    ├─lib 公共类库目录

│    ├─model 公共模型目录

│    ├─config.php 公共配置文件

│    ├─functions.php //公共函数

│    └─mapping.php //公共映射文件

├──home 应用目录

│    ├─controller 控制器目录

│    ├─model 模型目录

│    ├─common 公共目录

│    │    ├─config.php 配置文件

│    │    ├─functions.php 函数文件

│    │    └─mapping.php 映射文件

│    └─view 视图目录

│        └─default 模板目录

├─public_html 网站根目录

│    ├─public 公共目录

│    │    └─uploads 文件上传目录

│    ├─res 网站资源文件目录

│    │    └─home 对应的应用目录

│    │          └─default 对应的模板目录

│    │                ├─css

│    │                ├─js

│    │                └─images

│    └─index.php 入口文件

└─rundir 运行目录/临时文件

看着好麻烦啊 ,用我的批处理来完成吧,网站根目录下创建do.bat文件。

md core common home public_html rundir
cd common
md lib model
for %%a in (config.php functions.php mapping.php) do cd.>"%%a"
cd ../home
md controller  model common view
cd view
md default
cd ../common
for %%a in (config.php functions.php mapping.php) do cd.>"%%a"
dir
cd ../../public_html
md public res
cd public
md uploads
cd ../res

md home
cd home
md default
cd default
md css js images
cd ../../../
cd.>index.php
@echo ## 接下来将显示刚刚创建的目录树 ##
pause
cd ..
tree /F
pause

结果如图:

CMD批处理建文件夹与文件-第1张图片-莱芜网站制作中心

如果想将目录结构输出文件如下命令:

tree /f >tree.txt

莱芜做手机网站的莱芜网站制作中心为您服务,还满意吗?下面有打赏哦,谢谢。

抱歉,评论功能暂时关闭!