找回密码
 加入
搜索
查看: 3627|回复: 4

[AU3基础] 发现一个奇怪的问题,请看我详细说来!

[复制链接]
发表于 2014-4-29 20:00:53 | 显示全部楼层 |阅读模式
我本想制作一个自动创建宽带连接的脚本,因为这脚本打算隐藏运行,所以丢掉了WinWait 语句,改为Sleep语句,以下脚本暂时正确:
$Title = "新建连接向导"
ShellExecute("rundll32.exe","netshell.dll,StartNCW")
Sleep(500)
ControlClick($Title,"","[CLASS:Button; INSTANCE:2]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:1]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:6]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:2]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:9]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:2]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:12]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:1]","EditPaste","DGDSL1234567890")
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:2]","EditPaste","123456")
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:3]","EditPaste","123456")
ControlClick($Title,"","[CLASS:Button; INSTANCE:17]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:1]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:21]","",1)
添加最小化运行测试一下:
$Title = "新建连接向导"
ShellExecute("rundll32.exe","netshell.dll,StartNCW",@ScriptDir,"",@SW_MINIMIZE)
Sleep(500)
ControlClick($Title,"","[CLASS:Button; INSTANCE:2]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:1]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:6]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:2]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:9]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:2]","Check","")
Exit
ControlClick($Title,"","[CLASS:Button; INSTANCE:12]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:1]","EditPaste","DGDSL1234567890")
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:2]","EditPaste","123456")
ControlCommand($Title,"","[CLASS:Edit; INSTANCE:3]","EditPaste","123456")
ControlClick($Title,"","[CLASS:Button; INSTANCE:17]","",1)
Sleep(500)
ControlCommand($Title,"","[CLASS:Button; INSTANCE:1]","Check","")
ControlClick($Title,"","[CLASS:Button; INSTANCE:21]","",1)
1、结果脚本只能运行在Exit之前的语句,打开最小化的窗口为正常化后,发现取消按钮是不可用的,鼠标按下一步即会出错。
2、如果打开最小化窗口为正常化后,一路按上一步到第一个窗口时取消凡灰变亮了,此后手动一路下一步不会出错直到完成。

请问是什么原因导致取消按钮变灰,致使按下一下安装后出错?

请教如何完成这个隐藏自动完成宽带连接的脚本?(请提供源码,谢谢!)
 楼主| 发表于 2014-4-29 20:04:01 | 显示全部楼层
补充:XP系统
 楼主| 发表于 2014-4-30 21:43:05 | 显示全部楼层
有没有人能够帮个忙啊?
发表于 2014-5-3 09:04:04 | 显示全部楼层
这个都exit了....后面的肯定不会运行了
 楼主| 发表于 2014-5-3 10:33:36 | 显示全部楼层
回复 4# chriy


    Exit 后你手动打开窗口按下一步试试!(取消按钮灰色,下一步就会出错。)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-24 21:01 , Processed in 0.075672 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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