批处理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挂在共享文件夹
bat批处理中执行gulp界面闪而过,执行完后cmd窗口会关闭的解决办法
C# RestSharp和下载图片
Visual Studio(VS)发布自动使用Net Reactor给生成的DLL加壳
两台Linux之间自动同步文件
GZUpdate自动升级之自定义更新补丁程序
C#的进化——C#发展史、C#1.0-10.0语法系统性梳理、C#与JAVA的对比

热门标签
.NET Core .NET Reactor ag-grid AI发布 api安全 ASP.NET Core C#DLL加密 C#播放声音 C#代码混淆 C#代码加密 ChromeDriver Codex DateTime DBeaver devexpress devTool DLL混淆 edge.js EF EFCore Electron element-ui el-form el-table excel FastReport FileStream FolderBrowerDialog FolderSelectDialog form提交 git gridcontrol gridview input javascript json字符串 JS转换对象JSON jwt JWT授权 linq log Math MCP mitmproxy MVC MySQL Navicat netstat nginx node_modules NSwag Nuget Nuget镜像 number PowerShell pyinstaller python pythoncom python爬虫 python抓包 pywin32 redis Requests-html RestSharp Selenium sql SQL Server Swagger to-cms Visual Studio VSCode vue VueRouter vue路由 VUE页面通讯 Webpack Windows Windows服务 winform wmi xlrd yaml YESCMS YESWEB开发框架 白象 表单提交 播放声音 打开URL 代码混淆 弹窗提醒 端口占用 对象转换 分布式 公共字典 机器码 进程排查 静态资源 开发指南 路由参数 密钥 配置教程 配置文件 权限 人工智能 任务 任务调度 日期间隔 日志 日志记录 省市区 授权验证 数据库 四舍五入 文案 文件读取 文件夹选择 文件目录选择 问题排查 行政区域数据 页面通讯 中间件 CSharp 事务锁 工单系统 并发控制 重复提交 CMS Markdig Markdown markdown-it marked 技术选型 VS Code 开发工具 源代码管理 版本控制 Docker PostgreSQL 时区 部署排查 CMS架构 EF Core 主题系统 二次开发 插件系统 容器 运维命令 镜像清理 Linux NAS 远程挂载 飞牛 fnOS
联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码