DOS

bat及dos命令
1. echo回车
在echo后加“.” @echo.
2. 重命名文件
ren 原文件 新命名文件
新命名文件不得包含路径
3. bat切换到当前目录
cd /d %~dp0
4. copy
copy 原文件 目标目录
copy /y 可自动覆盖不询问
示例:

@ ECHO ***********************************
@ ECHO 柳州电务段生产调度指挥平台

@ ECHO ***********************************
@ ECHO 本程序将部署柳州电务段生产调度指挥平台
@echo.
cd /d %~dp0
@echo 替换WebContent\WEB-INF\t\cms\www\default\index\首页.html
rem ren ..\..\WebContent\WEB-INF\t\cms\www\default\index\首页.html 首页.html.backup.0
copy /y 首页.html ..\..\WebContent\WEB-INF\t\cms\www\default\index\

@echo 替换WebContent\WEB-INF\t\cms\www\default\include\页头导航栏.html
rem ren ..\..\WebContent\WEB-INF\t\cms\www\default\include\页头导航栏.html 页头导航栏.html.backup.0
copy /y 页头导航栏.html ..\..\WebContent\WEB-INF\t\cms\www\default\include\

@echo 替换WebContent\WEB-INF\t\cms\www\default\include\页脚信息栏.html
rem ren ..\..\WebContent\WEB-INF\t\cms\www\default\include\页脚信息栏.html 页脚信息栏.html.backup.0
copy /y 页脚信息栏.html ..\..\WebContent\WEB-INF\t\cms\www\default\include\

@echo 替换标题图片WebContent\r\cms\www\default\img\banner1.jpg
rem ren ..\..\WebContent\r\cms\www\default\img\banner1.jpg banner1.jpg.backup.0
copy /y banner1.jpg ..\..\WebContent\r\cms\www\default\img\

@echo 替换数据库配置WebContent\WEB-INF\config\jdbc.properties
copy /y jdbc.properties ..\..\WebContent\WEB-INF\config\

@echo.
@echo 执行完成
pause
exit

This entry was posted in Computer. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s