heimahack 发表于 2009-9-6 11:17:31

求自动静默安装补丁的AU3脚本

在网上找了自动安装系统补丁的脚本.编译后运行出错.不明白是我的编译器版本问题还是AU3脚本的问题.希望有人能发份自动静默安装系统补丁.本人用来做封装系统用.谢谢

#include <File.au3>
$FileList=_FileListToArray(@ScriptDir & "\Update","*.exe",1)
For $i=3 To 1 Step -1
ToolTip(@CR&"共" & $FileList & "个系统补丁," & $i & "秒后开始安装...   "
& @CR, @DesktopWidth-260, @DesktopHeight-100)
Sleep(1000)
Next
For $i=1 To $FileList
ToolTip(@CR&"正在安装 " & $FileList[$i] & " (" & $i & "/" & $FileList &")   "
& @CR, @DesktopWidth-320, @DesktopHeight-100)
RunWait(@ScriptDir & "\Update\" & $FileList[$i] & " /quiet /passive /norestart")
Next
ToolTip(@CR&"系 统 补 丁 安 装 完 毕 !"&@CR,@DesktopWidth-260,
@DesktopHeight-100)
Sleep(2000)


这段代码是网上找的.
编译后就出现这样的错误.贴个图出来.

131738 发表于 2009-9-9 17:41:27

复制你的源码到脚本编辑器,发现语句格式不对!应该没问题的!

你复制下段代码试试看....................#include <File.au3>
$FileList=_FileListToArray(@ScriptDir & "\Update","*.exe",1)
For $i=3 To 1 Step -1
        ToolTip(@CR&"共" & $FileList & "个系统补丁," & $i & "秒后开始安装...   " & @CR, @DesktopWidth-260, @DesktopHeight-100)
        Sleep(1000)
Next
For $i=1 To $FileList
        ToolTip(@CR&"正在安装 " & $FileList[$i] & " (" & $i & "/" & $FileList &")   " & @CR, @DesktopWidth-320, @DesktopHeight-100)
        RunWait(@ScriptDir & "\Update\" & $FileList[$i] & " /quiet /passive /norestart")
Next
ToolTip(@CR&"系 统 补 丁 安 装 完 毕 !"&@CR,@DesktopWidth-260, @DesktopHeight-100)
Sleep(2000)

志在行走 发表于 2010-3-19 20:50:21

>"D:\autoit3\SciTe\ACNWrapper\ACNWrapper.exe" /run /ErrorStdOut /in "E:\1.au3" /autoit3dir "D:\autoit3" /UserParams   
+>20:54:05 开始执行 ACNWrapper v.1.0.0.8
+> ============================================
+>执行环境:
+>        CPU构架:        X64
+>        系统构架:        X86
+>        系统语言:        0804
+>        键盘布局:        00000804
+>        IP地址:                192.168.1.33
+>        内存总量:        1023MB
+>        内存剩余:        563MB
+>        操作系统:        WIN_XP/Service Pack 3
+>        AU3版本:        3.3.5.6
+> ============================================
>运行 AU3Check (1.54.19.0)开始目录:D:\autoit3
+>20:54:05 AU3Check 完成:0
>运行:(3.3.5.6):D:\autoit3\autoit3.exe "E:\1.au3"   
E:\1.au3 (4) : ==> ???????????.:
ToolTip(@CR&"?" & $FileList & "??????" & $i & "??????...   " & @CR, @DesktopWidth-260, @DesktopHeight-100)
ToolTip(@CR&"?" & $FileList^ ERROR
->20:54:06 AutoIT3.exe 完成::1
+>20:54:07 ACNWrapper 完成..
>退出代码: 1    时间: 2.199

soby2010 发表于 2010-6-6 14:32:05

这倒底是哪个正确啊!!!!!

soby2010 发表于 2010-6-6 14:33:39

上面几个都是有点错误的。。希望能修改一下一步!!

david_hu 发表于 2010-6-13 14:34:19

顶顶,支持楼主!!

hooshen 发表于 2010-7-2 14:47:17

#include <File.au3>
    $FileList=_FileListToArray(@ScriptDir & "\Update","*.exe",1)
if @error Then
   MsgBox(0,"信息","Update目录下无补丁文件",3)
   Exit
EndIf

    For $i=3 To 1 Step -1
      ToolTip(@CR & " 共" & $FileList & "个系统补丁," & $i & "秒后开始安装... " & @CR, @DesktopWidth-260,@DesktopHeight-100)
      Sleep(1000)
    Next
    For $i=1 To $FileList
      ToolTip(@CR&" 正在安装 " & $FileList[$i] & " (" & $i & "/" & $FileList &") " & @CR, @DesktopWidth-320, @DesktopHeight-100)
      RunWait(@ScriptDir & "\Update\" & $FileList[$i] & " /passive /norestart /nobackup")
    Next
    ToolTip(@CR&"   系 统 补 丁 安 装 完 毕 !            " & @CR, @DesktopWidth-260,@DesktopHeight-100)
    Sleep(3000)

hooshen 发表于 2010-7-2 14:48:51

我这段也是网上找的,运行正常,只是有一点,不能判断补丁是否已经安装,如果安装过程中意外中断的话,重新运行脚本,又得重新来过,希望高手指点

12250279 发表于 2010-7-2 21:25:35

感谢大家的分享,嘿嘿,我去测试测试,
页: [1]
查看完整版本: 求自动静默安装补丁的AU3脚本