无法使用AutoIt运行JDK文件。谁能告诉我这段代码有什么问题?

时间:2016-04-12 06:36:55

标签: automation autoit

If $isSystem64bit = 1 Then
    $processID = Run("C:\Users\" & @UserName & "\Downloads\jdk-8u77-windows-x64.exe")

Else
    $processID = Run("C:\Users\" & @UserName & "\Downloads\jdk-8u77-windows-x32.exe")
EndIf

1 个答案:

答案 0 :(得分:1)

试试此代码

#RequireAdmin

If StringInStr(@OSArch, "64") Then
    $processID = Run(@UserProfileDir & "\Downloads\jdk-8u77-windows-x64.exe")
Else
    $processID = Run(@UserProfileDir & "\Downloads\jdk-8u77-windows-x32.exe")
EndIf