Jump to content

Running Java Install from Command line


dufran3
 Share

Recommended Posts

I am trying to execute a java install from within my script silently. Here are some lines I have tried. I was using variables, but hardcoded the path to first try and figure this part out. I can go to command prompt and type this in, and it starts up the java installer, but it will not from the script. help please.

RunWait("C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe")
_RunDOS("C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe")
RunWait(@ComSpec & " /c " & "C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe")

If I type this in command prompt

"C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe"

, the install starts. Help! :-)

Oops, here is what The console is spitting out.

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "H:\AutoIt\Software Dist\Java Upgrade\JavaCheck_1.1.au3"

H:\AutoIt\Software Dist\Java Upgrade\JavaCheck_1.1.au3 (222) : ==> Unable to execute the external program.:

RunWait('"C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe"')

The directory name is invalid.

Edited by dufran3
Link to comment
Share on other sites

RunWait('"C:\Temp\SoftwareDist\Java\j2re-1_4_2_13-windows-i586-p.exe"')

I noticed the above console output line has apostrophe + quote mark before the file, and quote mark + apostrophe after it. I would expect only quotes or apostrophes but not both. Not sure if that indicates the problem here, but I would wonder if that's normal.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

  • Moderators

I noticed the above console output line has apostrophe + quote mark before the file, and quote mark + apostrophe after it. I would expect only quotes or apostrophes but not both. Not sure if that indicates the problem here, but I would wonder if that's normal.

Either way works if there are no spaces in the path, however if there are spaces then Run() needs the path string wrapped in quotes itself.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Either way works if there are no spaces in the path, however if there are spaces then Run() needs the path string wrapped in quotes itself.

Well, I tried Run("c:\Program Files\test.exe") and that worked fine...

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

  • Moderators

Well, I tried Run("c:\Program Files\test.exe") and that worked fine...

Ok, you keep with that then :) ... :whistle:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I had the same problem a few days ago, and I searched the web for silent and java.

You can find things like Deployment tool

If you just want to install the java-program to the default-dir, just do a

RunWait('msiexec.exe /i '&$yourmsi&' /qn', 'C:', @SW_Hide')

If you don't have the msi-file, just install java once and search in the docs & settings-dir (it's in one of the hidden dirs).

Works like a charm here. :whistle:

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...