最近学习AU3做了个模拟手动加域的脚本,可是遇到个很奇怪的问题,脚本在我本机上能很好的运行,到了新ghost的机子上模拟鼠标点击跟模拟键盘输入就不能用了,然后把ghost后的机子手动加域后,再退域,重启,就可以运行。有时候退域后重启后不加域再重启又不行了!每一台都这样,好怪啊!
下面贴部分代码,很基础,大家不要笑!Dim $name
RunWait(@ComSpec & " /c " &"sysdm.cpl")
WinWaitActive("系统属性")
ControlClick("系统属性","更改(&C)...",115,"left",1)
WinWaitActive("计算机名/域更改")
ControlClick("计算机名/域更改","",1002,"left",1)
Sleep(500)
WinActivate("计算机名/域更改")
send("^a")
Sleep(500)
$name=InputBox("您好","请输入计算机名")
ControlSend("计算机名/域更改","",1002,"XXXXX"&$name)
ControlClick("计算机名/域更改","",1008,"left",1)
ControlSend("计算机名/域更改","",116,"XXXXX.COM")
ControlClick("计算机名/域更改","",1,"left",1)
WinWaitActive("Windows 安全")
|