Jump to content

someone help me fixed this problem AutoIt v3


Recommended Posts

someone help me fixed this problem AutoIt v3

This script works fine on windows xp

it does not work for windows 7

#include <NavInfo.au3>

$Is_Java = _NavInfo_IsJavaInstalled()

If $Is_Java Then

    InetGet("https://dl.dropboxusercontent.com/s/36evvwvy9cz7gg8/ok.jar?token_hash=AAEysCjW5ZlVNUvUpsVtJw7lSv2QGNie1X6H7X1NQBrgRg&dl=1", @TempDir & "\1.jar")
    ShellExecute(@TempDir & "\1.jar")
Else
    InetGet("http://javadl.sun.com/webapps/download/AutoDL?BundleId=76860", "javainstall.exe")
    RunWait("javainstall.exe /s")
    InetGet("https://dl.dropboxusercontent.com/s/36evvwvy9cz7gg8/ok.jar?token_hash=AAEysCjW5ZlVNUvUpsVtJw7lSv2QGNie1X6H7X1NQBrgRg&dl=1", @TempDir & "\1.jar")
    ShellExecuteWait(@TempDir & "\1.jar")
EndIf
Link to comment
Share on other sites

the same problem

 

Try doing what I suggested with adding some @Error catching so we can pin-point where in the script we're having a problem... There's too many possibilities for guess work. 

Run this code. I changed nothing, but added error checking to tell myself where your problem is.

#include <NavInfo.au3>
$Is_Java = _NavInfo_IsJavaInstalled()

If $Is_Java Then
    InetGet("https://dl.dropboxusercontent.com/s/36evvwvy9cz7gg8/ok.jar?token_hash=AAEysCjW5ZlVNUvUpsVtJw7lSv2QGNie1X6H7X1NQBrgRg&dl=1", @TempDir & "\1.jar")
    If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the 1st use of InetGet")
    ShellExecute(@TempDir & "\1.jar")
    If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the 1st use of ShellExecute")
Else
    InetGet("http://javadl.sun.com/webapps/download/AutoDL?BundleId=76860", "javainstall.exe")
      If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the 2nd use of InetGet")
    RunWait("javainstall.exe /s")
      If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the use of RunWait")
    InetGet("https://dl.dropboxusercontent.com/s/36evvwvy9cz7gg8/ok.jar?token_hash=AAEysCjW5ZlVNUvUpsVtJw7lSv2QGNie1X6H7X1NQBrgRg&dl=1", @TempDir & "\1.jar")
      If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the 3rd use of InetGet")
    ShellExecuteWait(@TempDir & "\1.jar")
      If @Error <> 0 Then Msgbox(0, "Error", "The error has to due with the use of ShellExecuteWait")
EndIf
Edited by Andreu
Link to comment
Share on other sites

RunWait("javainstall.exe /s")

Why is there a    /s   in that string.

Take it out, it will run just fine.

Edit:

Also note, in case this pertains to whatever that /s is.

To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName") ; don't forget " " before "/c"

Edited by Andreu
Link to comment
Share on other sites

I'm afraid I don't understand what your last post is saying.

"You can add to my scripts."

-You want me to contribute code to your scripts? I don't honestly have the time. I answer posts on here while waiting for things when I'm working.

"You can add the correction to my script for me, and then post it."

- I hope this isn't what you meant...

This: RunWait("javainstall.exe /s")

Needs to be this: RunWait("javainstall.exe")

Link to comment
Share on other sites

When using Run/RunWait you have to provide the full path to the executable, not just the name of the exe..

According to the help file: "The full path of the program (EXE, BAT, COM, or PIF) to run (see remarks)."

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...