Sign in to follow this  
Followers 0
dufran3

Running Java Install from Command line

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Have you tried ShellExecute?


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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I would try setting the working directory in the RunWait() function. It could be a permissions issue .

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

:whistle:

Share this post


Link to post
Share on other sites

Specifying the working directory fixed it. Thx!

Share this post


Link to post
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:

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