abhishek mishra
abhishek mishra

Reputation: 3

Unable to run JDK file using AutoIt. Can anyone tell me what is wrong in this code?

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

Upvotes: 0

Views: 45

Answers (1)

Milos
Milos

Reputation: 2946

Try this code

#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

Upvotes: 1

Related Questions