批处理bat共享文件夹自动对比文件如果有更新就上传,实现一键发布版本


批处理对比上传文件:

PowerShell 全选
@echo off
echo 文件夹校验
 
Set 远程=\\192.168.1.24\vss_erp\ERP
 
if not exist %远程% md %远程%
 
if not exist %远程%\config md %远程%\config 
if not exist %远程%\de md %远程%\de 
if not exist %远程%\es md %远程%\es 
if not exist %远程%\help md %远程%\help 
if not exist %远程%\images md %远程%\images 
if not exist %远程%\ImportAttendProvider md %远程%\ImportAttendProvider 
if not exist %远程%\ja md %远程%\ja 
if not exist %远程%\Reports md %远程%\Reports 
if not exist %远程%\ru md %远程%\ru 
 
echo 文件夹属性校验
attrib %远程%\config -r
attrib %远程%\de -r
attrib %远程%\es -r
attrib %远程%\help -r
attrib %远程%\images -r
attrib %远程%\ImportAttendProvider -r
attrib %远程%\ja -r
attrib %远程%\Reports -r
attrib %远程%\ru -r
 
echo 更新子文件夹内容
 
Attrib +s +h .\Config\user.ini
Attrib +s +h .\Config\SystemSettings.xml
Attrib +s +h .\Config\GridSettings.xml
xcopy .\Config\*.* %远程%\config\  /d /y
Attrib -s -h .\Config\user.ini
Attrib -s -h .\Config\SystemSettings.xml
Attrib -s -h .\Config\GridSettings.xml
 
 
 
 
 
xcopy .\de\*.* %远程%\de\  /d /y
xcopy .\es\*.* %远程%\es\ /d /y
xcopy .\help\*.* %远程%\help\  /d /y
xcopy .\images\*.* %远程%\images\   /y
xcopy .\ImportAttendProvider\*.* %远程%\ImportAttendProvider\  /d /y
xcopy .\ja\*.* %远程%\ja\  /d /y
xcopy .\Reports\*.* %远程%\Reports\  /d /y
xcopy .\ru\*.* %远程%\ru\  /d /y
 
 
echo 更新INI文件
xcopy .\*.ini %远程% /d /y
echo 更新所需EXE
xcopy .\ERP.*.exe %远程% /d /y
echo 更新所需DLL
xcopy .\*.dll %远程% /d /y
echo 更新升级批处理
xcopy .\AutoUpdate.bat %远程% /d /y
xcopy .\更新版本*.bat %远程% /d /y
 
del /f /s %远程%\ERP.Update2Server.exe
del /f /s %远程%\*.vshost.exe
 
exit

批处理对比下载文件:

PowerShell 全选
@echo off
 
echo 结束进程
TASKKILL /F /IM ERP.AttendMonitor.exe /T
TASKKILL /F /IM ERP.Main.exe /T
 
 
echo 文件夹校验
 
 
Set 远程=\\192.168.1.24\vss_erp\ERP
 
if not exist .\config md .\config
if not exist .\de md .\de 
if not exist .\es md .\es 
if not exist .\help md .\help 
if not exist .\images md .\images 
if not exist .\ImportAttendProvider md .\ImportAttendProvider 
if not exist .\ja md .\ja 
if not exist .\Reports md .\Reports 
if not exist .\ru md .\ru 
 
echo 文件夹属性校验
attrib .\config -r
attrib .\de -r
attrib .\es -r
attrib .\help -r
attrib .\images -r
attrib .\ImportAttendProvider -r
attrib .\ja -r
attrib .\Reports -r
attrib .\ru -r
 
echo 更新子文件夹内容
 
 
 
Attrib +s +h %远程%\Config\user.ini
Attrib +s +h %远程%\Config\SystemSettings.xml
del .\Config\GridSettings.xml /s /f
Attrib +s +h %远程%\Config\GridSettings.xml
xcopy %远程%\Config\*.* .\config\  /d /y
Attrib -s -h %远程%\Config\user.ini
Attrib -s -h %远程%\Config\SystemSettings.xml
Attrib -s -h %远程%\Config\GridSettings.xml
 
xcopy %远程%\de\*.* .\de\  /d /y
xcopy %远程%\es\*.* .\es\ /d /y
xcopy %远程%\help\*.* .\help\  /d /y
del .\images\16_Edit.ico /s /f
xcopy %远程%\images\*.* .\images\  /d /y /c
xcopy %远程%\ImportAttendProvider\*.* .\ImportAttendProvider\  /d /y
xcopy %远程%\ja\*.* .\ja\  /d /y
xcopy %远程%\Reports\*.* .\Reports\  /d /y
xcopy %远程%\ru\*.* .\ru\  /d /y
 
echo 更新所需EXE
xcopy %远程%\*.exe . /d /y
echo 更新所需DLL
xcopy %远程%\*.dll . /d /y
 
xcopy %远程%\AttendImporter.ini . /d /y
 
echo 更新升级批处理
xcopy %远程%\更新版本*.bat . /d /y
 
start .\ERP.Main.exe
exit
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:使用nuget-server搭建私有Nuget包服务器后,nginx反向代理无法下载包
下一篇:八个独家珍藏的「免费」设计素材网
评论列表

发表评论

评论内容
昵称:
关联文章

批处理bat共享文件夹自动对比文件如果更新实现发布版本
局域网共享文件自动更新办法
VS ClickOnce发布的时候,版本号更新,但是是提示“已发布版本在服务器已存在,是否覆盖它?”
TS两个对象,便利B对象的属性,如果A对象这个属性,把B的值更新到A对象。
html+js文件
bat脚本:生成项目并自动加壳发布
批处理nuget包脚本
文件图片组件使用
次解决Nancy参数绑定“bug”开始发布自己的第一个nuget包(篇)
Microsoft Store 桌面应用发布流程()之打包应用
页面快排插件配置支持图片
次解决Nancy参数绑定“bug”开始发布自己的第一个nuget包(下篇)
版本记录
开源网盘》》文件共享软件
linux挂在共享文件夹
C# RestSharp和下载图片
Visual Studio(VS)发布自动使用Net Reactor给生成的DLL加壳
bat批处理中执行gulp界面闪而过,执行完后cmd窗口会关闭的解决办法
C#的进化——C#发展史、C#1.0-10.0语法系统性梳理、C#与JAVA的对比
GZUpdate自动升级之自定义更新补丁程序

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码