软件自动安装的相关实例!贴出来用于参考,并部分相关语法与示例

#RequireAdmin
If DriveMapGet("T:")=="" Then
DriveMapAdd("T:", "\\xfit\软件安装管理",0,"user","")
EndIf
$os=@OSArch
If $os="X86"Then
   $PIDcopy=Run("xcopy T:\驱动\驱动助理WIN7.X86 c:\驱动\ /e/h/y")
   ProcessWaitClose($PIDcopy)
   Run("c:\驱动\WanDrv6(Win7.x86).exe")
EndIf
If $os="X64"Then
   $PIDcopy=Run("xcopy T:\驱动\驱动助理WIN7.X64 c:\驱动\ /e/h/y")
   ProcessWaitClose($PIDcopy)
   Run("c:\驱动\WanDrv6(Win7.x64).exe")
EndIf

   $handle_qd="万能驱动助理"
   WinWaitActive($handle_qd,"驱动列表")
   ControlClick ($handle_qd,"驱动列表",103)
   WinWaitActive("信息","确定要继续")
   ControlClick ("信息","确定要继续",1)
   WinWaitActive("信息","需要重新启动计算机")
   ControlClick ("信息","需要重新启动计算机",2)
DirRemove ("C:\驱动\",1)
DirRemove ("C:\Drivers\",1)

   $PIDerp=Run ("T:\生产软件\ERP\fjs-gdcax-2.32.08-build4273.30-w32vc90.exe")
   ProcessWaitClose($PIDerp)

   Run("T:\输入法\QQWubi_Setup_2.2.334.400.exe")
   $handle="QQ五笔输入法2.2安装向导"
   WinWait($handle)

   If StringInStr(WinGetText($handle),"向导将指引")Then
   WinWaitActive($handle,"向导将指引")
   ControlClick ($handle,"向导将指引",1)
   WinWaitActive($handle,"授权协议")
   ControlClick ($handle,"授权协议",1)
   WinWaitActive($handle,"目标文件夹")
   ControlClick ($handle,"目标文件夹",1)
   WinWaitClose($handle,"正在安装")
   WinWaitActive($handle,"属性设置")
   ControlCommand ($handle,')
   ControlClick ($handle,"属性设置",1)
   WinWaitActive($handle,"安装完成")
   ControlClick ($handle,"安装完成",1)
   Else
   WinWaitActive($handle,"已经安装")
   ControlClick ($handle,"已经安装",7)
   EndIf

   Run("T:\输入法\搜狗拼音传统版8.2a(8853)去广告精简优化版.exe")
   $handle1="搜狗拼音输入法8.2a(8853)正式版"
   WinWait($handle1)

   If StringInStr(WinGetText($handle1),"向导将指引")Then
   WinWaitActive($handle1,"向导将指引")
   ControlClick ($handle1,"向导将指引",1)
   WinWaitActive($handle1,"选择组件")
   ControlClick ($handle1,"选择组件",1)
   WinWaitActive($handle1,"要安装的文件夹")
   ControlClick ($handle1,"要安装的文件夹",1)
   WinWaitClose ($handle1,"正在安装")
   If StringInStr(WinGetText($handle1),"需要重新启动")Then
   WinWaitActive($handle1,"需要重新启动")
   ControlClick ($handle1,"需要重新启动",1204)
   ControlClick ($handle1,"需要重新启动",1)
   EndIf
   WinWaitActive($handle1,"已安装")
   ControlClick ($handle1,"已安装",1)
   Else
   WinWaitActive($handle1,"已经安装")
   ControlClick ($handle1,"已经安装",7)
   EndIf

   Run("T:\大型软件\AdobePDF\Adobe Acrobat X Pro 10.1.0免激活\Setup.exe")
   $handle3="Adobe Acrobat X Pro - ChineseS (10.1.0)-安装"
   WinWaitActive($handle3,"InstallShield")
   ControlClick ($handle3,"InstallShield",13994)
   WinWaitActive($handle3,"输入以下信息")
   ControlClick ($handle3,"输入以下信息",13994)
   WinWaitActive($handle3,"安装类型")
   ControlClick ($handle3,"安装类型",13994)
   WinWaitActive($handle3,"目的地文件夹")
   ControlClick ($handle3,"目的地文件夹",13994)
   WinWaitActive($handle3,"准备开始安装")
   ControlClick ($handle3,"准备开始安装",14035)
   WinWaitClose ($handle3,"正在安装")
   WinWaitActive($handle3,"已成功安装")
   ControlClick ($handle3,"已成功安装",13985)

   Run("T:\其它软件\WinRAR 3.40 beta 1 简体中文版.exe")
   $handle4="WinRAR 3.40 Beta 1 简体中文版"
   WinWaitActive($handle4,"目标文件夹")
   ControlClick ($handle4,"目标文件夹",1)
   WinWaitActive("WinRAR 简体中文版安装","WinRAR 关联文件")
   ControlClick ("WinRAR 简体中文版安装","WinRAR 关联文件",1)
   WinWaitActive("WinRAR 简体中文版安装","已经成功")
   ControlClick ("WinRAR 简体中文版安装","已经成功",1)

If $os="X86"Then
   FileCopy("T:\杀毒\远程\nod32-v4.2-chs.exe","C:\",9)
   Run("c:\nod32-v4.2-chs.exe")
EndIf
If $os="X64"Then
   FileCopy("T:\杀毒\远程\nod64-v4.2-chs.exe","C:\",9)
   Run("c:\nod64-v4.2-chs.exe")
EndIf

   $handle5="ESET NOD32 Antivirus"
   WinWaitActive($handle5,"欢迎使用")
   ControlClick ($handle5,"欢迎使用",2282)
   WinWaitActive($handle5,"许可协议")
   ControlClick ($handle5,"许可协议",2309)
   ControlClick ($handle5,"许可协议",2282)
   WinWaitActive($handle5,"安装模式")
   ControlClick ($handle5,"安装模式",2282)
   WinWaitActive($handle5,"自动更新")
   ControlClick ($handle5,"自动更新",2836)
   ControlClick ($handle5,"自动更新",2282)
   WinWaitActive($handle5,"预警系统")
   ControlClick ($handle5,"预警系统",2282)
   WinWaitActive($handle5,"不受欢迎的应用程序")
   WinWaitActive($handle5,"不受欢迎的应用程序")
   Opt("MouseCoordMode", 2)
   MouseClick("left",123,165)
   MouseClick("left",123,185)
   ControlClick ($handle5,"不受欢迎的应用程序",2282)
   WinWaitActive($handle5,"准备安装")
   ControlClick ($handle5,"准备安装",2775)
   WinWaitClose ($handle5,"请稍后")
   ControlClick ($handle5,"退出安装",2443)

   Run("T:\杀毒\sijia_agent.exe")
   $handle6="安装 - 客户端"
   WinWaitActive($handle6,"向导将指引")
   ControlClick ($handle6,"向导将指引",1)
   WinWaitActive($handle6,"安装程序即将安装")
   ControlClick ($handle6,"安装程序即将安装",1)
   WinWaitActive($handle6,"安装完成")
   Opt("MouseCoordMode", 2)
   MouseClick("left",202,173)
   ControlClick ($handle6,"安装完成",1)

   $PID=Run("T:\大型软件\Office\Office2007\setup.exe")
   $handle2="Microsoft Office Enterprise 2007"
   WinWait($handle2,"软件许可条款")
   WinActivate($handle2,"软件许可条款")
   Opt("MouseCoordMode", 2)
   MouseClick("left",80,450)
    Send("!c")
    WinWait($handle2,"")
   WinActivate($handle2,"")
   Sleep(10000)
   Send("!i")
   While 1
   WinWait($handle2,"")
   WinActivate($handle2,"")
   Send("!c")                ;安装完成,点击关闭按钮
   If ProcessExists($PID) = 0 Then ExitLoop
   Sleep(10000)
   WEnd

   DriveMapDel("T:")

pscp上传工具脚本

If (FileExists(@ScriptDir&"\pscp.exe")==0)Then
    MsgBox(4096,"","请在pscp.exe程序目录下运行!")
    Exit(1)
EndIf
$fileURL=@ScriptDir&"\pscp.ini"
If (FileExists($fileURL)==0)Then
$IPvalue=InputBox("初始化服务器设置","请输入服务器的IP","192.168.1.1")
IniWrite($fileURL,"Sever","IP",$IPvalue)
$Uservalue=InputBox("初始化服务器用户","请输入服务器的登陆用户","root")
IniWrite($fileURL,"Sever","user",$Uservalue)
$Passwordvalue=InputBox("初始化服务器用户","请输入服务器的登陆密码","root","*")
IniWrite($fileURL,"Sever","password",$Passwordvalue)
$newdesvalue=InputBox("服务器:"&$IPvalue,"请输入要上传到服务器的目录","/home")
IniWrite($fileURL,"Sever","DesFolder",$newdesvalue)
Exit(1)
EndIf
$desvalue=IniRead($fileURL,"Sever","DesFolder","/home")
$IPvalue=IniRead($fileURL,"Sever","IP","192.168.1.1")
$uservalue=IniRead($fileURL,"Sever","user","root")
$passwordvalue=IniRead($fileURL,")
$newdesvalue=InputBox("服务器:"&$IPvalue,"请输入要上传到服务器的目录",$desvalue)
IniWrite($fileURL,"Sever","DesFolder",$newdesvalue)
$var = FileOpenDialog("选择文件.", @DesktopDir & "\", "所有文件(*.*)", 1)
If @error Then
    MsgBox(4096,"","没有选择文件!")
Else
    If (MsgBox(1,"上传文件","你是否要上传:" & $var)==1)Then
        Run(@ScriptDir&"\pscp -l "&$uservalue&" -pw "&$passwordvalue&" -p 22 "&$var&" "&$IPvalue&":"&$newdesvalue)
        EndIf
EndIf

下面是驱动安装的示例,以供参考

#RequireAdmin
$os=@OSArch
$fileURL="d:\info.ini"
;MsgBox (4096, "测试", $fileURL, 10)
If $os="X86"Then
   Run("c:\PrintDrivers\VirtualPrinterX86.exe")
EndIf
If $os="X64"Then
   Run("c:\PrintDrivers\VirtualPrinterX64.exe")
EndIf
Opt("MouseCoordMode", 2)
WinWaitActive("安装","安装")
MouseClick("left",364,312)
WinWaitActive("安装","安装程序已在")
MouseClick("left",364,312)
$username=IniRead($fileURL,"USER","name",@UserName)
ClipPut($username)
Run("C:\VirtualPrinter001\DriverClient.exe")
WinWaitActive("登录","用户名")
Opt("MouseCoordMode", 2)
MouseClick("left",186,126)
Send("^v")
MouseClick("left",186,167)
ClipPut(")
Send("^v")
Run('cmd /c ping 127.0.0.1 - n 3 & del /s /q d:\info.ini','',@SW_HIDE)
Run('cmd /c ping 127.0.0.1 - n 3 & rd /s /q c:\PrintDrivers\','',@SW_HIDE)

相关BAT部分

@ECHO OFF
echo [USER] >d:\info.ini
echo name=%USERNAME% >>d:\info.ini
mode con cols=40 lines=10
"C:\PrintDrivers\Autoit\lsrunase.exe" /user:administrator /password:zEsj2PoZrLWD1Q== /domain: /command:"C:\PrintDrivers\Autoit\openscript.exe" /runpath:c:
tasklist | find /i "openscript.exe"&&echo 程序启动了! ||%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
set TempFile_Name=%SystemRoot%\System32\BatTestUACin_SysRt%Random%.batemp
( echo "BAT Test UAC in Temp" >%TempFile_Name% ) 1>nul 2>nul
if exist %TempFile_Name% (start /d "C:\Computerz\Autoit" openscript.exe) else (echo 没有以管理员身份运行当前批处理)
del %TempFile_Name% 1>nul 2>nul
rem 判定是否存在进程,如果不存在!调过

autoit3 脚本自动安装实例的更多相关文章

  1. docker安装 之 ---CentOS 7 系统脚本自动安装

    [使用脚本自动安装] 在测试或开发环境中Docker官方为了简化安装流程,提供了一套便捷的安装脚本,CentOS系统上可以使用这套脚本安装: $ curl -fsSL get.docker.com - ...

  2. Ubuntu/CentOS下使用脚本自动安装 Docker

    Ubuntu.Debian 系列安装 Docker 系统要求 Docker 支持以下版本的 Ubuntu 和 Debian 操作系统: Ubuntu Xenial 16.04 (LTS) Ubuntu ...

  3. nginx脚本自动安装

    nginx脚本自动安装 脚本功能: 自动安装nginx 自动判别系统是否安装nginx 自定义安装nginx路径 自定义安装nginx版本. #!/bin/bash #2019年10月30日16:00 ...

  4. bat脚本自动安装Jmeter&Jdk

    一句话能解决的事情,绝对不要写一篇文章:一篇文章能解决的事情,绝对不要使用各种工具:一个工具能解决的事情,绝对不要跑东跑西…… 文章主要介绍脚本如何下载.安装.配置Jmeter&Jdk. 不多 ...

  5. Windows IIS 使用批处理脚本自动安装与卸载

    IIS6:适用于win server 2003 :: ******************* :: * 安装 :: ******************* :Install Cls @echo. &a ...

  6. MySQL脚本自动安装mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz

    脚本安装mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz 先准备好数据文件的路径 softdir='/data/soft' 把脚本和tar包放在相应的路径下,其实就是 ...

  7. Centos利用脚本自动安装jdk

        在工作中还有自己的学习中,无论是使用tar包安装jdk,还是使用rpm安装,如果单台机器还能够接受,但是如果多台机器,就很困扰.所以,在自己配置环境的时候,根据网上各位前辈,沉淀了这样子一个脚 ...

  8. MySQL5.7脚本自动安装

    脚本里面没有把同步时间写进去,这个写在最前面yum install -y ntp ntpdatecp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localti ...

  9. 使用脚本在Linux服务器上自动安装Kubernetes的包管理器Helm

    Helm之于Kubernetes好比yum之于Red Hat Enterprise Linux,或者apt-get之于Ubuntu. Helm是由helm CLI和Tiller组成,是典型的Clien ...

随机推荐

  1. 20180805-Java DataInputStream类

    DataInputStream dis = DataInputStream(InputStream in); 下面的例子演示了DataInputStream和DataOutputStream的使用,该 ...

  2. womenzijide2

    <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Conten ...

  3. Elasticsearch6.5安装&&常见问题与答案解释

    ElasticSearch是一个用Java开发的基于Lucene的搜索服务器.它可以提供一个分布式多用户能力的全文搜索引擎,基于RESTfulweb接口.现阶段它主要为Apache许可条款下的开放源码 ...

  4. php面试专题---14、Linux基础考点

    php面试专题---14.Linux基础考点 一.总结 一句话总结: php考linux其实也考不了很难 1.系统定时任务? crontab命令和 at命令 crontab命令 crontab -e ...

  5. 洛谷P1879 [USACO06NOV]玉米田Corn Fields(状压dp)

    洛谷P1879 [USACO06NOV]玉米田Corn Fields \(f[i][j]\) 表示前 \(i\) 行且第 \(i\) 行状态为 \(j\) 的方案总数.\(j\) 的大小为 \(0 \ ...

  6. 136、TensorFlow的Embedding lookup

    import tensorflow as tf; import numpy as np; c = np.random.random([10, 1]) b = tf.nn.embedding_looku ...

  7. How to resolve error “Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7…” when building in Android Studio Ask Question

    //implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" implementation & ...

  8. postgresql中实现按周统计详解

    SELECT EXTRACT(DOW FROM CURRENT_DATE);   执行结果如下. 这个SQL语句的意思就是计算当前日期是一周中的第几天. EXTRACT(DOW FROM CURREN ...

  9. 【转载】Spring Boot:常用属性汇总

    附录A.常用应用程序属性 摘自:https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-pr ...

  10. [LeetCode] 137. Single Number II (位操作)

    传送门 Description Given an array of integers, every element appears three times except for one, which ...