局域网共享文件自动更新办法


局域网共享文件自动更新办法

局域网文件更新,

强制结束进程

TASKKILL /F /IM ERP.Main.exe /T 

如果服务器上版本较新,则更新本地

xcopy %远程%\更新版本*.bat . /d /y

代码示例

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
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开发框架网发布内容,转载请附上原文出处连接
管理员
上一篇:Python清源CPM项目CPM-LM-TF2研究日志
下一篇:阿里云免费SSL证书申请
评论列表

发表评论

评论内容
昵称:
关联文章

局域网共享文件自动更新办法
批处理bat共享文件夹自动对比文件如果有更新就上传,实现一键发布版本
GZUpdate自动升级之自定义更新补丁程序
VSCode无法格式化python代码py文件的解决办法
更新部署
数据库中发生这个错误:无法为数据库 中的对象 分配空间,因为 'PRIMARY' 文件组已满。请删除不需要的文件、删除文件组中的对象、将其他文件添加到文件组或为文件组中的现有文件启用自动增长,以便增加可用磁盘空间。
linux挂在共享文件夹
GZUpdate自动升级程序客户端演示
GZUpdate自动升级服务 .NET C/S Winform客户端程序自动升级演示
CentOS7 nginx SSL证书申请并自动续期
npm更新安装包,重新安装
如何运行.ipynb文件
文件加密技术研究
RazorEngine不能使用@Html.Raw引起的连锁反应以及解决办法
Visual Studio(VS)发布自动使用Net Reactor给生成的DLL加壳
基础字典管理功能开发-表结构设计,模型更新和数据库迁移脚本生成
yarn更新依赖包
fastreport明细自动高度
dotnet 将自动代码格式化机器人带入团队 GitLab 平台
20210913 更新日志

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