If I have two java uninstall strings right next to another and say I was in loop 100/300 and it gets uninstalled. #RequireAdmin Uninstall Strings - HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall For $i = 1 to 300 $sKey1 = RegEnumKey ( "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $i ) If Then ExitLoop $sKey2 = RegRead ( "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & $sKey1, "DisplayName" ) If Then ContinueLoop If StringInStr($sKey2, "Java") Then MsgBox(0, "", $sKey2 & " Uninstall String Is" & & & $sKey1) If StringInStr ( $sKey2, "Java" ) Then Sleep ( 1000 ) RunWait ( & " /c MsiExec /X " & $sKey1 & " /qn", "C:", ) EndIf Next For $i = 1 to 300 $sKey1 = RegEnumKey ( "HKLM64\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $i ) If Then ExitLoop $sKey2 = RegRead ( "HKLM64\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & $sKey1, "DisplayName" ) If Then ContinueLoop If StringInStr($sKey2, "Java") Then MsgBox(0, "", $sKey2 & " Uninstall String Is" & & & $sKey1) If StringInStr ( $sKey2, "Java" ) Then Sleep ( 1000 ) RunWait ( & " /c MsiExec /X " & $sKey1 & " /qn", "C:", ) EndIf Next MsgBox ( 0, "", "Uninstall of All Java Versions Completed" )Įdit: Hmm I have an idea of what it might be.
#WMIC UNINSTALL WILDCARDS CODE#
I'll post the source code I have so far and maybe somebody can see my error or offer up a better solution. I added a Sleep() incase it was a issue with running too fast (Like I ran into the other day with renaming files in a loop) but still the same. So it is removing it, but question is why do I have to run it again. Installing 3 versions of Java on my computer for testing it seems to get 2 out of 3 and requires me to run the script again to get the 3rd. I started to work on the uninstall part and have one small issue.
#WMIC UNINSTALL WILDCARDS UPDATE#
So I need to update Java on a lot of devices along with an application.