找回密码
 加入
搜索
查看: 2127|回复: 3

[AU3基础] 如何填写判断语句

[复制链接]
发表于 2012-2-9 11:03:14 | 显示全部楼层 |阅读模式
朋友们请教个问题”:
我的目的是想把IE6升级成IE8  在运行脚本时先检查电脑上是否已是IE8 如是IE8折结束脚本。
谁能高手我这叫判断语句该怎样写。我现已编写好的没有判断语句,在线苦等谢谢!
MsgBox(0,"安装警告","开始升级IE8请勿触动鼠标键盘",4)
RunAs("zengfh","apcarrier",$sPassword,0,"\\172.28.45.175\itshare$\InternetExplorer-v8.0\UTC-ENG-Internet Explorer-v8.0-ALL-r1.0.2.EXE")
Sleep("2000")
WinWait("Internet Explorer 8 Upgrade")
Sleep("400")
WinActivate("Internet Explorer 8 Upgrade")
WinWaitActive("Internet Explorer 8 Upgrade")
ControlClick("Internet Explorer 8 Upgrade","","Button1")
WinWait("Internet Explorer 8 Upgrade","Do you want to view the script log")
Sleep("200")
WinActivate("Internet Explorer 8 Upgrade")
WinWaitActive("Internet Explorer 8 Upgrade")
Sleep("300")
ControlClick("Internet Explorer 8 Upgrade","","Button2")
Sleep("500")
MsgBox(0,"安装提示","已完成IE8升级请手动重启电脑",10)
发表于 2012-2-9 12:17:57 | 显示全部楼层
IE的版本存在下面的注册表键值中,取出来一判断就可以了

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version
 楼主| 发表于 2012-2-9 12:36:13 | 显示全部楼层
朋友能在帮我说下 该怎样去写 这判断语句吗?我新手还很搞不清楚。
发表于 2012-2-9 14:56:30 | 显示全部楼层
本帖最后由 forxuan 于 2012-2-9 15:09 编辑
Local $a,$b
$a = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer","Version")
$b = StringLeft($a,3)
If $b == "8.0" Then
        MsgBox(0,"提示","当前IE浏览器的版本为:"& $b)
Else
        MsgBox(0,"提示","当前IE浏览器的版本为:"& "其它版本")
EndIf
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 22:36 , Processed in 0.083968 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表