/build/static/layout/Breadcrumb_cap_w.png

I get a VB Script error

When I run the extraction script in the same folder as the jre-8u40-windows-i586.exe file, I get the following error:

Line: 73

Char:1

Error: Object Variable Not Set

Any help would be most appreciated?


0 Comments   [ + ] Show comments

Answers (4)

Answer Summary:
Posted by: aragorn.2003 9 years ago
Red Belt
1
What do you mean with the extraction script. If you want to extract the contents of the JAVA installer, you can just execute the file and before you continue to install you need to copy the extracted files from C:\Users\USERNAME\AppData\LocalLow\Sun\Java\jre1.8.0_40_x64 folder.

After copy the jre1.8.0_40.msi you can cancel the installer.

Comments:
  • In the "Oracle Java 8 8 Update 40" topic, truealph posted a script that would extract the msi. I have used the location you mentioned to grab the msi but thought that I would give this a try. I got the stated error and was wondering if it was something I was doing wrong or is there a problem with the script? - cottonakin 9 years ago
    • That's the price you pay for using a script which has no error-trapping!

      Now, when I paste the script into an editor, line 73 doesn't contain any object use so please run the script in a debugger and post the full line of actual code where the script stops.

      BTW, I agree - why bother with a script when you can just grab the payload when the EXE runs? Bizarre! - anonymous_9363 9 years ago
      • arrLatestFilex86 = Split(LatestFilex86, "-") - cottonakin 9 years ago
Posted by: anonymous_9363 9 years ago
Red Belt
1

A not very well-written script, this one.

You need to put the source file (which needs to have "jre" and either "586" or "x64" in its name) into a sub-folder called 'Source' branching from the folder where the script resides. You also need the 64-bit version in that same folder, otherwise line 74 is going to error in the same way.

I'd rebuild it so that the file from which you want to extract is dropped on to the script and ditch the 32/64 activity.

I'd also eliminate this awful code:

comRunLatestFilex86 = oShell.Run(chrDoubleQuote & LatestFilex86.Path & chrDoubleQuote, 1, False)
WScript.Sleep(15000)
comTerminateLatestFilex86 = oShell.Run("taskkill.exe" & chrSpace & "/im" & chrSpace & chrDoubleQuote & LatestFilex86.Name & chrDoubleQuote & chrSpace & "/f", 0, True)
WScript.Sleep(15000)

This is typical "I can't be bothered to do it properly so I'm going to fudge it" code. He runs the EXE, waits 250 seconds and then kills the process. Did it finish? Why do I care? Two minutes is long enough for any process to run, right? Jeez...Any normal person would use one of the quadzillion code examples out there which start a process and then wait for its completion. The real clue to this chap's propensity for half thought-through nonsense, though, is stuff like this:

    CreateDestinationFolderx86 = oShell.Run("cmd.exe /c mkdir" & chrSpace & chrDoubleQuote & WorkingDir & "\Extracted\" & LatestFileVersionx86 & "\x86" & chrDoubleQuote, 0, True)

Really? "mkdir"? When you just used the FileSystemObject's CreateFolder method 30-odd lines before? And note there's no check to see if the folder got created or not, here or anywhere else in the script.

As I already mentioned, I really wouldn't bother making any changes at all as I find it fairly straightforward to run the EXE and then browse to the "live" extraction folder, "%USERNAME%\AppData\LocalLow\Sun\Java".


Comments:
  • Hi VBScab. I agree. It´s pretty easy to run the exe, copy the msi and cancel the installation. i takes 30 seconds, without any error,

    And i also confirm that this is a not very well written script. - aragorn.2003 9 years ago
Posted by: anonymous_9363 9 years ago
Red Belt
1
Get hold of the 'Microsoft Script Editor' or one of the Visual Studio Shell packages. Either will allow you to perform just-in-time debugging of scripts. The simple expedient of hovering over each element of the offending line would've shown you that the variable 'LatestFilex86' was empty. Tracking back to find the line where that variable is populated would then have led you to the source of the problem.
Posted by: cottonakin 9 years ago
Senior Yellow Belt
1
Thanks to everyone for the answers and especially "VBScab" for the education. I think it is a good thing to reach out of the box once in a while, in this case my very, very basic knowledge of vb scripts versus simply getting the msi file like I always have. You have educated me and I have learned and that is never a bad thing.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ