Access快速开发平台--实用好用的批处理
时 间:2018-06-22 12:11:30
作 者:lmqlt ID:18637 城市:广州
摘 要:Access快速开发平台实用好用的批处理
正 文:
批处理是比较基本的应用,将批处理与大系统相结合,将方便研发人员和管理人员,并大大减少工作量和差错率。
压缩包1:自己整理了一个升级包生成批处理,运行批处理自动将设定的文件夹内容生成一个自解压文件(无需手动设置是否静默、解压覆盖等);
压缩包2:在程序里可根据版本不同,自动生成批处理并运行,无需快速开发平台函数库支持,减少升级差错可能,同时也使程序更简洁、智能。
附 件:
升级包制作批处理:调用WinRAR压缩软件对相应文件夹压缩,自动生成统一的升级包。
@echo off
color 9F
echo:
echo 说 明
echo _________________________________________________________________
echo:
echo 即将“C:\lgcnew”制作成升级包,请移除“Update.mde”等无需升级文件,
echo 准备好后按任意键开始。
echo _________________________________________________________________
echo:
pause
echo:
(echo Path=C:\
echo Silent=1
echo Overwrite=1)>int.txt
C:\Progra~1\WinRAR\winrar.exe a -sfx -ep1 -m5 c:\lgcsj.exe C:\lgcnew
C:\Progra~1\WinRAR\winrar.exe c -zint.txt c:\lgcsj.exe
del "int.txt"
echo:
echo 备 注
echo _________________________________________________________________
echo:
echo 升级包制作成功,请在c:\下拷贝"lgcsj.exe"至服务器,
echo 以便客户端自动升级程序。
echo _________________________________________________________________
echo:
@ echo. & pause
Function Qclj() '清除垃圾
Dim temp As String
temp = "@echo off" & vbCrLf & "echo 正在清除系统垃圾文件,请稍等......" & vbCrLf & _
"del /f /s /q %systemdrive%\*.tmp" & vbCrLf & _
"echo. & pause"
Open "c:\Qclj.bat" For Output As #1
Print #1, temp
Close 1
Shell "cmd /c C:\Qclj.bat", 1 '要不显示运行 ,用vbHide代替“1”
End Function
ACCESS生成批处理并运行程序
Function Xtsz() '系统设置
On Error Resume Next
Open "C:\Xtsz.bat" For Output As #1
Print #1, "@echo off "
Print #1, "color 9F"
Print #1, "title [离退休系统升级程序]"
Print #1, "if ""%1"" == ""h"" goto begin"
Print #1, " mshta vbSScript:createobject("; wscript.Shell; ").run(""%~nx0 h"",0)(window.close)&&exit"
Print #1, ": begin"
Print #1, "ping 127.0.0.1 -n 5"
Print #1, "REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Access\Security"" /v ""Level"" /t REG_DWORD /d ""1"" /f"
Print #1, "REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Security"" /v ""Level"" /t REG_DWORD /d ""1"" /f"
Print #1, "REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security"" /v"; "vbawarnings"" /t REG_DWORD /d ""1"" /f"
Print #1, "REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security"" /v ""vbawarnings"" /t REG_DWORD /d ""1"" /f"
Print #1, "REG ADD ""HKEY_CURRENT_USER\Software\Microsoft\Shared Tools\Graphics Filters\Import\JPEG\Options"" /v ""ShowProgressDialog"" /t REG_SZ /d ""No"" /f"
Print #1, "REG ADD ""HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Graphics Filters\Import\JPEG\Options"" /v ""ShowProgressDialog"" /t REG_SZ /d ""No"" /f"
Print #1, "REG ADD HKEY_CLASSES_ROOT\MSPaper.Document /v EditFlags /t REG_DWORD /d 65536 /f"
Print #1, "REGSVR32.EXE /s MSCOMCTL.OCX"
Print #1, "REGSVR32.EXE /s MSCOMCT2.OCX"
Print #1, "ping 127.0.0.1 -n 3"
Print #1, "del ""C:\Xtsz.bat"" "
Print #1, "echo. & pause"
Close #1
Set ws = CreateObject("Wscript.Shell")
ws.Run "cmd /c C:\Xtsz.bat", 1 '要不显示运行 ,用vbHide代替“1”
End Function
Function sjcx() '系统升级
On Error Resume Next
If Dir("C:\lgcsj.exe") <> "" Then Kill "C:\lgcsj.exe"
Open "C:\sjcx.bat" For Output As #1
Print #1, "@echo off "
Print #1, "color 9F"
Print #1, "title [离退休系统升级程序]"
Print #1, "if ""%1"" == ""h"" goto begin"
Print #1, " mshta vbSScript:createobject("; wscript.Shell; ").run(""%~nx0 h"",0)(window.close)&&exit"
Print #1, ": begin"
Print #1, "SET wait=ping -n 2 127.0.0.1 ^>^nul"
Print #1, "for /l %%n in (5,-1,0) do ("
Print #1, " rem cls"
Print #1, " echo **************************************"
Print #1, " echo."
Print #1, " echo 更新离退休系统,请耐心等待... %%n"
Print #1, " echo."
Print #1, " echo **************************************"
Print #1, " %wait%"
Print #1, " cls"
Print #1, " )"
Print #1, " set ftpUser=lgc" '服务器用户名
Print #1, " set ftpPass=8311****" '登陆密码
Print #1, " set ftpIP=192.168.2.2" 'IP地址
Print #1, " set ftpFolder=/lgc/" 'FTP文件夹
Print #1, " set LocalFolder=C:/" '下载升级包至客户端位置
Print #1, " set ftpFile=%temp%/TempFTP.txt"
Print #1, ">""%ftpFile%"" ( " & vbCrLf & _
"echo,%ftpUser%" & vbCrLf & _
"echo,%ftpPass%" & vbCrLf & _
"echo cd ""%ftpFolder%""" & vbCrLf & _
"echo lcd ""%LocalFolder%""" & vbCrLf & _
"echo bin" & vbCrLf & _
"echo mget *.*" & vbCrLf & _
"echo bye" & vbCrLf & _
")"
Print #1, "start /min ftp -v -i -s:""%ftpFile%"" %ftpIP%"
Print #1, "ping /n 5 127.0.0.1>nul"
Print #1, ":jiancha "
Print #1, "dir /a-d C:\lgcsj.exe >nul 2>nul"
Print #1, "if %errorlevel%==0 (goto :yunxin) else ping /n 2 127.0.0.1>nul & goto :jiancha"
Print #1, ":yunxin"
Print #1, "start/wait """" ""C:\lgcsj.exe"""
Print #1, "ping /n 3 127.0.0.1>nul"
'Print #1, "start """" ""C:\lgcnew\Main.mde"""
Print #1, ":jiancha1 "
Print #1, "dir /a-d C:\lgcsj.exe >nul 2>nul"
Print #1, "if %errorlevel%==0 (goto :try) else ping /n 1 127.0.0.1>nul & goto :jiancha1 "
Print #1, ":try"
Print #1, "del /a /f /q ""C:\lgcsj.exe"""
Print #1, "echo 完成新程序安装,感谢你的大力支持!"
Print #1, "del ""C:\sjcx.bat"""
Print #1, "Exit"
Close #1
Set ws = CreateObject("Wscript.Shell")
ws.Run "cmd /c C:\sjcx.bat", 1 '要不显示运行 ,用vbHide代替“1”
End Function
Access快速开发平台QQ群 (群号:321554481) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access对子窗体数据进行批...(10.30)
- 最精简的组合框行来源数据快速输...(10.25)
- Access仿平台的多值选择器...(10.24)
- 【Access日期区间段查询】...(10.22)
- 【Access源码示例】VBA...(10.12)
- Access累乘示例,Acce...(10.09)
- 数值8.88,把整数8去掉,转...(10.08)
- 【Access自定义函数】一个...(09.30)
- 【Access选项卡示例】Ac...(09.09)
学习心得
最新文章
- Access快速开发平台--对上传...(11.22)
- Access快速开发平台企业版--...(11.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)
- 微软Access邀测新Monaco...(11.12)
- Access列表框左右互选、列表框...(11.11)
- 高效率在导入数据前删除记录(11.10)
- Access报价单转订单示例代码(11.08)
- Access系统自带的日期选择器不...(11.08)