chishingchan 发表于 2014-4-29 20:00:53

发现一个奇怪的问题,请看我详细说来!

我本想制作一个自动创建宽带连接的脚本,因为这脚本打算隐藏运行,所以丢掉了WinWait 语句,改为Sleep语句,以下脚本暂时正确:$Title = "新建连接向导"
ShellExecute("rundll32.exe","netshell.dll,StartNCW")
Sleep(500)
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","EditPaste","DGDSL1234567890")
ControlCommand($Title,"","","EditPaste","123456")
ControlCommand($Title,"","","EditPaste","123456")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
添加最小化运行测试一下:$Title = "新建连接向导"
ShellExecute("rundll32.exe","netshell.dll,StartNCW",@ScriptDir,"",@SW_MINIMIZE)
Sleep(500)
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
Exit
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","EditPaste","DGDSL1234567890")
ControlCommand($Title,"","","EditPaste","123456")
ControlCommand($Title,"","","EditPaste","123456")
ControlClick($Title,"","","",1)
Sleep(500)
ControlCommand($Title,"","","Check","")
ControlClick($Title,"","","",1)
1、结果脚本只能运行在Exit之前的语句,打开最小化的窗口为正常化后,发现取消按钮是不可用的,鼠标按下一步即会出错。
2、如果打开最小化窗口为正常化后,一路按上一步到第一个窗口时取消凡灰变亮了,此后手动一路下一步不会出错直到完成。

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

请教如何完成这个隐藏自动完成宽带连接的脚本?(请提供源码,谢谢!)

chishingchan 发表于 2014-4-29 20:04:01

补充:XP系统

chishingchan 发表于 2014-4-30 21:43:05

有没有人能够帮个忙啊?

chriy 发表于 2014-5-3 09:04:04

这个都exit了....后面的肯定不会运行了

chishingchan 发表于 2014-5-3 10:33:36

回复 4# chriy


    Exit 后你手动打开窗口按下一步试试!(取消按钮灰色,下一步就会出错。)
页: [1]
查看完整版本: 发现一个奇怪的问题,请看我详细说来!