RedaSabe Posted June 24, 2013 Share Posted June 24, 2013 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 More sharing options...
JohnOne Posted June 24, 2013 Share Posted June 24, 2013 "it does not work for windows 7" is not good enough. Elaborate. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Andreu Posted June 24, 2013 Share Posted June 24, 2013 Put some If @Error Then MsgBox(0, "Error - #", @Error) lines in your code... Your code alone won't help us help you. Link to comment Share on other sites More sharing options...
Dreamora Posted June 24, 2013 Share Posted June 24, 2013 Add #RequireAdmin at the top of your script Link to comment Share on other sites More sharing options...
RedaSabe Posted June 24, 2013 Author Share Posted June 24, 2013 the same problem Link to comment Share on other sites More sharing options...
Andreu Posted June 24, 2013 Share Posted June 24, 2013 (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 June 24, 2013 by Andreu Link to comment Share on other sites More sharing options...
RedaSabe Posted June 24, 2013 Author Share Posted June 24, 2013 "Error", "The error has to due with the use of RunWait") Link to comment Share on other sites More sharing options...
JohnOne Posted June 24, 2013 Share Posted June 24, 2013 the same problem Which is? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Andreu Posted June 24, 2013 Share Posted June 24, 2013 (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 June 24, 2013 by Andreu Link to comment Share on other sites More sharing options...
RedaSabe Posted June 24, 2013 Author Share Posted June 24, 2013 you can add to my scripts Link to comment Share on other sites More sharing options...
Andreu Posted June 24, 2013 Share Posted June 24, 2013 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 More sharing options...
RedaSabe Posted June 24, 2013 Author Share Posted June 24, 2013 ok Link to comment Share on other sites More sharing options...
water Posted June 24, 2013 Share Posted June 24, 2013 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 - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now