The script will uninstall the older version of java, install a new version, and also disable auto-updates. Finally, you can deploy java with sccm Moreover follow the link for more information: Deploy Java. If you have any questions about the silent install of java feel free to ask in the comment section.
Table of Contents. Java Silent Install. Prev Article. Next Article. Neil Laplink. Get answers from your peers along with millions of IT pros who visit Spiceworks.
Any suggestions? I am a new intern so learning on the fly here, thanks. Best Answer. Pure Capsaicin. Little Green Man This person is a verified professional. Echo "Finished problematic process check.
Echo "" WScript. Quit 1 End Select Next 'Resume normal error handling. On Error Goto 0 WScript. Echo "" 'This call will remove x64 versions on a x64 system and x86 versions on a x86 system. If objProcessor. Shell" 'The following SWbem setup allows a script running in a x86 context, such as under the SCCM client, on a x64 system 'to access the full x64 registry.
AddressWidth objWbemContext. ConnectServer ". This way we don't keep values for other pieces of software. If Err. Description Wscript. It currently doesn't. Clear End If 'Slightly convoluted logic that determines if we're keeping or removing specific versions. Echo "Java versions 1. ElseIf Instr 1, strUninstallString, "msiexec.
Run strUninstallString, 0, true WScript. Echo "" End If Next 'Resume normal quit on error behavior. Description Err. Close If Err. Echo "Removes Java runtimes based on command line parameters. Echo "Does not uninstall Java versions 1. Echo "Removes all Java Runtimes without creating logs. Echo "Keeps all Java Runtimes. Only useful for making a list of installed runtimes. Posted by: Oranif 2 years ago. Posted by: ComputerX 12 years ago.
Then modify it to include error handling. My coworker added the ability to exclude a version of the JRE. He isn't a VBS person, but it seems to work. Here is his version. Close If Not blFound Then ts. Close WScript. These processes will cause the installer to fail. Shell" wshShell. Comments: Are you guys doing something to make this look formatted? That is gibberish!
Is there no code tag here? Posted by: Daz 12 years ago. Dan, You're addition is pretty much what I would have advised anyway. VBScab, I appreciate the comments about error trapping. Error-Trapping is immensely time consuming.
I used Altiris NS to push out the script. The calling script copied the logs back to a central location, and I could see from NS if the process was attempted. Therefore: 1: If the script failed catastrophically before logging anything, I would see the script fail from NS.
If any of those computers fail to create the only two objects I use here WScript. Shell and Scripting. FileSystemObject the computer would have far more problems than running my script. I would have retrieved the registry settings directly using the stdRegProv. I only shelled out in this sub to retain the same format used by muaddip in his original effort. Having said that, I completely accept your point about checking the variable contains data, under normal circumstances.
But if the msiexec process fails to uninstall one of the versions because the process is still running, the msiexec return code will be logged in the log. I agree completely with your critique, however I believe that the effort you put into error-trapping has to be proportionate to the chances of an error occurring undetected. In my case and I only wrote the script for my situation, sharing was a courtesy , it was virtually impossible for the script to fail and me not know about it.
Many thanks, Daz. Here is our latest version. FolderExists strLogPath Then fso. Exiting Script. Posted by: clyrigham 12 years ago. Some return codes will try to perform the installation again, other give the SMS a failed message and other return a successfully!
I hope this can help you! Alas, I do not code. Therefor I am limited to what I can get people to do for me. It is slightly reworked to avoid some false positives. Posted by: umaparvathy 11 years ago. Hi All, Right now i'm packaging Apache 2. This code is really useful to me to uninstall all versions of apache I'm writting a script to uninstall all versions of apache But i couldn't understand some part of your code Please help me out Here is the content of registry.
JRE 1. How can i get the uninstall string Please guide me So that i can finish my apache uninstall code WriteLine String ,"-" ts. Echo "Apache Http Server 2. Quit 0 I've to proceed futher with the elseif part of currentversion Thanks in advance Regards, uma. Posted by: meofcourse 10 years ago. Basically it uses a second temp file for uninstall routines found in the WOWNode section of the registry and changes the formula for CLSID for these as well an 85 character offset rather than I am sure that this modification could be prettier in the code, but this is the easiest.
Thanks for the previous posts. They have helped tremendously. Posted by: drlandau 10 years ago. Maybe someone can use this info as well. Posted by: tamahome 9 years ago. How about this for uninstalling all versions? Comments: Tamahomer has the right idea. Make it simple. Get rid of it all: All Java 5,6,7 gone. Posted by: schrotti12 6 years ago. Comments: This works, but it's a little careless. I would be careful with this one.
Yeah, you are right. I don't use this product but a more specific filter would be useful. Thanks for the hint! I tried it and it works. I changed it in the code.
Posted by: keyrage 8 years ago. Comments: UPDATE: New and improved version now written as a full module with switches to either specify a version to leave installed or to test the result without uninstalling anything.
Posted by: gpalau 6 years ago. Disclaimer: Use this at your own risk. Also had errors until I replaced them with keyboard standard.
Side note, when you are trying to do domain computers, you might be required to surround the computer name in quotes. When I have to uninstall things on my network I have to do. I put this one together that will start the process to the entire list at once in different command prompts.
I usually do around 30 computers. More than that and the command prompts slow down. I have all my text files on the C: drive. Some computers hangs up for some reason.
You have to be patient while the uninstall process starts.
0コメント