alfs Posted February 15, 2012 Share Posted February 15, 2012 Hay (I am from Norway and my English isn't that good - sorry) I want to update Java on several PC-s (Win XP-pro) by sending the users an exe-file that will copy an update-file from server and run this in silent mode as PC-administrator. The code below seems to do what I want on my PC - updating to ver 31. Tried it on another PC with Java 6 Update 18 and 26 - 18 was left, but 26 was removed and ver 31 was installed. What is missing - is there an uninstall-Jva - file like Flash-Player has? Is it possible to show a progress-bar while doing the job? Anything else wrong with my code? ; Updating Java #include <File.au3> Global $sUserName = "administrator" Global $sPassword = "password" Global $sNetwork = "domain" ; Ends Internett Explorer to avoid that Java is being used Local $PID = ProcessExists("iexplore.exe") ; Will return the PID or 0 if the process isn't found. While $PID ProcessClose($PID) $PID = ProcessExists("iexplore.exe") WEnd ; Install current verison of Java ; Creates a temporary map on C:\ DirCreate("C:\tmp") ; Copies the install-program from server to C:\tmp FileCopy("\\dc1\felles\lærarar\a\Java\jre-6u31-windows-i586-s.exe", "C:\tmp") ; Runs RunAsWait as administrator and installs Java in silent mode RunAsWait($sUserName, $sNetwork, $sPassword, 4, "C:\tmp\jre-6u31-windows-i586-s.exe /s INSTALLDIR=C:\Programfiler\Java\jre6") ; Deletes the temporary installationfile on C: DirRemove("C:\tmp", 1) MsgBox(0, "Updating Java", "Update done") AlfS Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now