dufran3 Posted February 22, 2007 Share Posted February 22, 2007 (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 February 22, 2007 by dufran3 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 23, 2007 Moderators Share Posted February 23, 2007 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. Link to comment Share on other sites More sharing options...
SadBunny Posted February 23, 2007 Share Posted February 23, 2007 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 More sharing options...
Moderators SmOke_N Posted February 23, 2007 Moderators Share Posted February 23, 2007 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 More sharing options...
SadBunny Posted February 23, 2007 Share Posted February 23, 2007 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 More sharing options...
Moderators SmOke_N Posted February 23, 2007 Moderators Share Posted February 23, 2007 Well, I tried Run("c:\Program Files\test.exe") and that worked fine...Ok, you keep with that then ... 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 More sharing options...
MHz Posted February 23, 2007 Share Posted February 23, 2007 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') Link to comment Share on other sites More sharing options...
dufran3 Posted February 23, 2007 Author Share Posted February 23, 2007 Specifying the working directory fixed it. Thx! Link to comment Share on other sites More sharing options...
dabus Posted February 23, 2007 Share Posted February 23, 2007 I had the same problem a few days ago, and I searched the web for silent and java.You can find things like Deployment toolIf you just want to install the java-program to the default-dir, just do aRunWait('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. 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