本帖最后由 pdp320921 于 2011-3-9 21:39 编辑 If FileExists(@ProgramFilesDir & "\TOSHIBA\CTest\CTest.exe") Then
mode()
Else
install()
Sleep(1000)
mode()
EndIf
Func install()
...
...
EndFunc
Func mode()
$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion", "ProductName")
If $var ='Windows 7 Starter' Then
autorun1()
Else
autorun2()
EndIf
EndFunc
Func autorun1()
Run(@ProgramFilesDir & "\TOSHIBA\CTest\CTest.exe")
WinWaitActive("CTest v2.4.0201","")
ControlClick("CTest v2.4.0201","",7)
WinWaitActive("Browse for Folder","Select the Remote Test Path")
Send("{Down}")
Send("{ENTER}")
WinWaitActive("CTest v2.4.0201","Test Mode")
ControlClick("CTest v2.4.0201","",14)
Send("{Down 3}")
Send("{ENTER}")
Send("{TAB 6}")
Sleep(500)
Send("500")
WinWaitActive("CTest v2.4.0201","")
ControlClick("CTest v2.4.0201","",26)
EndFunc
Func autorun2()
Run(@ProgramFilesDir & "\TOSHIBA\CTest\CTest.exe")
WinWaitActive("CTest v2.4.0201","")
ControlClick("CTest v2.4.0201","",7)
WinWaitActive("Browse for Folder","Select the Remote Test Path")
Send("{Down}")
Send("{ENTER}")
WinWaitActive("CTest v2.4.0201","")
Send("{TAB 9}")
Send("500")
WinWaitActive("CTest v2.4.0201","")
ControlClick("CTest v2.4.0201","",26)
EndFunc
我原想是判断系统如果是Win7 Starter版本执行autorun1(),其他版本执行autorun2(),
可程序编译好后在Win7 Starter系统版本的电脑上执行的结果却是autorun2(),在其他版本系统的机器上执行的也是autorun2()
注明:注册表里的键值没问题~
真不知错在哪?恳请大虾们帮忙~不 |