使用 windows 批处理指令(BAT文件)进行文件删除、复制操作

时间:2022-01-18 21:37:15

 以下是做文件删除和复制的批处理指令

::替换文件需要添加 /y 参数才能直接替换.不然会出现提示是否替换.

::复制Axis2Implementation和WebServices编译后的文件到tomcat的webapps\axis2\WEB-INF\services和modules目录下
@echo off
echo "先删除tomcat对应目录下的三个旧文件:Rdu-v1_0.aar、Log4JInit.aar、durLicense.mar"
del /f /s /q C:\Medimpact\RDUService\webapps\axis2\WEB-INF\services\Rdu-v1_0.aar
del /f /s /q C:\Medimpact\RDUService\webapps\axis2\WEB-INF\services\Log4JInit.aar
del /f /s /q C:\Medimpact\RDUService\webapps\axis2\WEB-INF\modules\durLicense.mar
echo.
echo "复制 WebServices的Rdu-v1_0.aar到tomcat的webapps\axis2\WEB-INF\services 目录下"
copy /y C:\Development\2015.09.16.2.0\WebServices\Source\Implementation\RDU-WS\deploy\Rdu-v1_0.aar C:\Medimpact\RDUService\webapps\axis2\WEB-INF\services\

echo "复制 Axis2Implementation的Log4JInit.aar到tomcat的webapps\axis2\WEB-INF\services 目录下"
copy /y C:\Development\2015.09.16.2.0\Axis2Implementation\Source\Implementation\ServiceLib\deploy\Log4JInit.aar C:\Medimpact\RDUService\webapps\axis2\WEB-INF\services\


echo "复制 Axis2Implementation的durLicense.mar到tomcat的webapps\axis2\WEB-INF\modules 目录下"
copy /y C:\Development\2015.09.16.2.0\Axis2Implementation\Source\Implementation\ServiceLib\deploy\durLicense.mar C:\Medimpact\RDUService\webapps\axis2\WEB-INF\modules\

 

 原文地址:

https://www.cnblogs.com/poterliu/p/11212772.html