Batch file question, skipping errors or "OK" to errors
-
Saturday, January 19, 2013 1:14 AM
Can skip to bold if too wordy haha.
Hey guys, I created a push for java 7 update 11 and it was broken, so for my test group, the java update shows as installed in the programs list but the control panel for java is broken. I fixed my push but it doesnt work because since it shows up as installed in the programs list it skips the push AND if it was legitimately installed already say by a power user or sys admin, it in turn breaks the proper install. So I decided to create a batch file that will uninstall any current version of java 7 update 11 that is installed and then reinstall it. This is helpful because I don't want to break any power user installs and this was tested and works great. Now this also works to fix the test group of broken installs BUT the batch file now requires user input, it says there was a dll error and you have to click OK to continue. What can I put in my batch file to skip this dll error and continue with the batch file or how can I enter an "ok" in reference to this dll error and continue with the batch file? My code so far:
REM - Kills any process that might break the install again taskkill /F /IM iexplorer.exe taskkill /F /IM iexplore.exe taskkill /F /IM firefox.exe taskkill /F /IM chrome.exe taskkill /F /IM javaw.exe taskkill /F /IM jqs.exe taskkill /F /IM jusched.exe REM - Uninstalls any same version of java 7 update 11 32 and 64 bit msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f86417011FF} /qn msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f83217011FF} /qn taskkill /F /IM iexplorer.exe taskkill /F /IM iexplore.exe taskkill /F /IM firefox.exe taskkill /F /IM chrome.exe taskkill /F /IM javaw.exe taskkill /F /IM jqs.exe taskkill /F /IM jusched.exe REM - Install java 7 update 11 msiexec.exe /i jre1.7.0_11.msi /qn exitAny help would be greatly appreciated, thanks guys.
- Edited by MMAniac911 Saturday, January 19, 2013 1:19 AM
All Replies
-
Saturday, January 19, 2013 1:21 AM
You can't. It is not possible to respond to an installer prompt with a batch file. Fix the installer.¯\_(ツ)_/¯
- Proposed As Answer by jrvMicrosoft Community Contributor Monday, January 21, 2013 11:38 PM
-
Saturday, January 19, 2013 1:27 AM
what dll error?
where in the batch file does this happen?
and what is the error?
-
Saturday, January 19, 2013 1:44 AM
I can't post a image i guess, but heres a link to imageshack:
http://img202.imageshack.us/img202/836/javafail.jpg
basically RunDLL: There was a problem starting C:\Program Files\Java\jre7\bin\\installer.dl
The specified module could not be found.happens after:
msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f86417011FF} /qn
-
Saturday, January 19, 2013 2:05 AM
as previously stated that error cannot be handled in a batch file. You have to incorporate more brain into the solution.
Run it as system. That will do the trick. Create a task in task manager and run it with system rights.
Test this first manually before going through the scripting of task manager.Java does not include a totally silent option on their MSI package, some packages do but this one does not (as of Juse 2012 and before). You would have to write a new package or write an app that watched for that prompt and hit OK with it (autoit and c# can do this, I recommend Autoit).
- Proposed As Answer by CountryStyle Saturday, January 19, 2013 2:05 AM
- Edited by CountryStyle Saturday, January 19, 2013 2:06 AM
- Edited by CountryStyle Saturday, January 19, 2013 2:07 AM
- Unproposed As Answer by Bill_StewartMicrosoft Community Contributor, Moderator Tuesday, January 29, 2013 3:51 PM
-
Saturday, January 19, 2013 2:28 AM
You may need a restart in between the uninstall and the re-install.
The MSI may not support a silent install, but the windows offline installer does...
http://www.java.com/en/download/help/silent_install.xml
Windows offline installer available here:
http://www.java.com/en/download/manual.jsp
Inspired by Heineken.
- Proposed As Answer by CountryStyle Saturday, January 19, 2013 2:38 AM
- Marked As Answer by Bill_StewartMicrosoft Community Contributor, Moderator Tuesday, January 29, 2013 3:52 PM
-
Saturday, January 19, 2013 2:38 AM
One thing that is being ignored here is that java has already been removed. THe error that is popping up is a system error. The installer cannot find the custom installer DLL fo java because I has been deleted.
Oracle has a "cleaner' that can be run which will track down all old installations and remove them from the registry. This is the easiest way to fix this. Just run this and then install the jre 7 update package and you will be set.
This is one of the reasons we have banned java from all workstations without special needs. Recently nearly all web applications have switched to EcmaScript. The few that still require java we handle as exceptions.
Java is excellent on a web server or for an application that needs to be cross platform. It is a mess to support as a browser scripting language.
¯\_(ツ)_/¯
-
Saturday, January 19, 2013 5:43 AMModerator
Recently nearly all web applications have switched to EcmaScript. The few that still require java we handle as exceptions.
Java is excellent on a web server or for an application that needs to be cross platform. It is a mess to support as a browser scripting language.It's a common mistake to confuse Java with JavaScript (aka ECMAScript). From http://www.java.com/en/download/faq/java_javascript.xml:
The JavaScript programming language, developed by Netscape, Inc., is not part of the Java platform.
Bill
-
Saturday, January 19, 2013 5:56 AM
Actually the syntax of javascript is a subset of java. (that does not include the latest version of EcmaScript.
On XP IE stopped delivering The Microsoft version of Java and did not have javascript as a replacement. We were forced to install java for many websites. Now most websites use EcmaScript and Java I not supported. I know because we tore java out of many web site over the last 10 years.
Java was maintained by many clients because that believed it was still necessary. It seldom is. When it is then only those machines should install it.
Many companies use Java internally for their own applications. In these cases java is usually needed everywhere.
If you cannot identify why Java is needed then it should be disabled.
I have one client where I disabled Java and on manager screamed. He had to have Java on every machine. Later we found that he and some department people were having a weekly gaming contest. The online game required Java.
If Java is required it needs a lot of maintenance. Only use it if you really need it. Don't just install it because it has always been installed.
¯\_(ツ)_/¯
-
Saturday, January 19, 2013 3:15 PMModerator
Actually the syntax of javascript is a subset of java. (that does not include the latest version of EcmaScript.
On XP IE stopped delivering The Microsoft version of Java and did not have javascript as a replacement.JavaScript has similar syntax to Java in many ways, but it is a completely separate language and was never a "subset" of Java, and JavaScript was not designed as a Java replacement. JavaScript was first named "LiveScript" and was renamed to "JavaScript" for marketing reasons. The name has caused confusion ever since.
http://en.wikipedia.org/wiki/JavaScript
Bill
- Edited by Bill_StewartMicrosoft Community Contributor, Moderator Saturday, January 19, 2013 3:31 PM
-
Saturday, January 19, 2013 5:52 PM
I did not say it WAS a subset I said the syntax (and components) of early JavaScript were a subset of Java. That is not the same thing as sating they are the same.
Microsoft used its own version of Java and JavaScript nearly interchangeably which is what led to the split with Sun refusing Microsoft rights to use the name Java or to distribute anything tat resembled Java.
¯\_(ツ)_/¯
-
Saturday, January 19, 2013 11:37 PMModerator
The purpose of my posts was to clear up any misconception that Java and JavaScript are somehow the same or related. They're completely separate.
Bill
-
Sunday, January 20, 2013 1:06 AM
The purpose of my posts was to clear up any misconception that Java and JavaScript are somehow the same or related. They're completely separate.
Bill
And my point was that since early 2000 Java has been mostly unnecessary for public web sites but may still be getting installed because no one realizes that.
¯\_(ツ)_/¯
-
Sunday, January 20, 2013 4:22 AMModerator
And my point was that since early 2000 Java has been mostly unnecessary for public web sites but may still be getting installed because no one realizes that.
Java is completely separate from JavaScript, and this has nothing whatsoever to do with opinions about whether Java is a necessary browser plug-in.
In any case, this thread has drifted off-topic.
Bill
-
Monday, January 21, 2013 11:19 PM
So I'm just gonna fix my broken installs by hand since this is taking so long and there isn't that many and so I can push this exploit fix (already cracked I hear) out sooner, I just tried to install this on another patch test computer and it appeared to run however msiexec.exe didnt do anything, I checked the logs and it says:
Product: Java 7 Update 11 (64-bit) -- Error 1730.You must be an Administrator to remove this application. To remove this application, you can log on as an Administrator, or contact your technical support group for assistance
I am a domain admin, so not sure whats going on. Anyway I tried installing with a local Admin account and it worked as intended, why is it doing this? Again my code is:
REM - Kills any process that might break the install again
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM - Uninstalls any same version of java 7 update 11 32 and 64 bit
C:\WINDOWS\system32\msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f83217011FF} /qn
C:\WINDOWS\system32\msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f86417011FF} /qn
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM - Install java 7 update 11
C:\WINDOWS\system32\msiexec.exe /i jre1.7.0_11.msi /qn
exitI thought I was gonna be good to go to push this out via SCCM 2007 but now I'm not sure its even gonna work.
-
Monday, January 21, 2013 11:38 PM
So I'm just gonna fix my broken installs by hand since this is taking so long and there isn't that many and so I can push this exploit fix (already cracked I hear) out sooner, I just tried to install this on another patch test computer and it appeared to run however msiexec.exe didnt do anything, I checked the logs and it says:
Product: Java 7 Update 11 (64-bit) -- Error 1730.You must be an Administrator to remove this application. To remove this application, you can log on as an Administrator, or contact your technical support group for assistance
I am a domain admin, so not sure whats going on. Anyway I tried installing with a local Admin account and it worked as intended, why is it doing this? Again my code is:
REM - Kills any process that might break the install again
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM - Uninstalls any same version of java 7 update 11 32 and 64 bit
C:\WINDOWS\system32\msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f83217011FF} /qn
C:\WINDOWS\system32\msiexec.exe /X {26a24ae4-039d-4ca4-87b4-2f86417011FF} /qn
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM - Install java 7 update 11
C:\WINDOWS\system32\msiexec.exe /i jre1.7.0_11.msi /qn
exitI thought I was gonna be good to go to push this out via SCCM 2007 but now I'm not sure its even gonna work.
I tried to tell you that what you are trying to do cannot be done. The helpful users here do not seem to know what is happening. I do. I have been through this already.
Contact Oracle support and they will give you the cleanup utility.
Since you only have a few machines just do it manually.
¯\_(ツ)_/¯
-
Monday, January 21, 2013 11:43 PMI know that the user interaction part is not going to work and I'm gonna fix those 10 or so by hand but this is a new issue that I wanna get working to push out via SCCM 2007 to about 400 machines... its that my code above, specifically the msiexec.exe works great when I tested it on my own machine but on several other machines I get the message that you need to be an Admin to install, my admin rights don't seem to be working and I'm a domain admin, but local admin works, so I think I'm missing something else now.
Does SCCM use the SYSTEM account to install the package so that really I don't have anything to worry about?- Edited by MMAniac911 Monday, January 21, 2013 11:44 PM
- Edited by MMAniac911 Monday, January 21, 2013 11:44 PM
- Edited by MMAniac911 Monday, January 21, 2013 11:47 PM
-
Monday, January 21, 2013 11:55 PM
I know that the user interaction part is not going to work and I'm gonna fix those 10 or so by hand but this is a new issue that I wanna get working to push out via SCCM 2007 to about 400 machines... its that my code above, specifically the msiexec.exe works great when I tested it on my own machine but on several other machines I get the message that you need to be an Admin to install, my admin rights don't seem to be working and I'm a domain admin, but local admin works, so I think I'm missing something else now.
Does SCCM use the SYSTEM account to install the package so that really I don't have anything to worry about?
You need to get a patch for SCCM for Window 7. Check the KB or contact MS Support.
Are you sure you are setting the task up correctly so that it runs with full rights.
This has nothing to do with your uninstall issues. If you need to pursue it you need to post in the SCCM forum. It is not a scripting issue.
Java can also be removed by deleting all of the registry keys (can be done remotely) then reboot, After the reboot you can just delete the java folders. This effectively uninstall Java. You amy also want to scan the registry installer key and remove all uninstaller references to java for cosmetic reasons.
¯\_(ツ)_/¯
-
Tuesday, January 22, 2013 12:57 AMModerator
A quick web search for "java removal tool" also yields something that looks useful (not tested by me):
http://singularlabs.com/software/javara/
Bill
-
Wednesday, March 20, 2013 10:35 AM
Hi there, you are "my last hope"... I already tried to contact Oracle Germany to get the Java Removal Tool You mentioned, but the Support Hotline could not help me at all... They even didn´t know that there is a tool or something like that. Could you please offer a download-location or a valid source for the program, I have 240 clients - all of them with broken software deployment ( WPKG got stuck while installing JRE ) because of JRE 7 U 11, 13, 15 and 17...
They really messed up their f***ing Installer... Every release means new bugs to fix and to pray that your systems are still running afterwise...
Please help us out... THX - Greetings from Germany
-
Wednesday, March 20, 2013 2:55 PMModerator
Hi,
Sorry but this is a scripting forum, not a Java software support forum.
Bill

