Hello again everyone -
I’m looking for a working fixlet that would remove any version of JAVA runtime (or, for now, any version for JAVA 8, not for JAVA 11, though that would be needed later I think).
I’ve seen multiple threads on this, and saw where someone was asking for the same thing (Uninstalling ALL Versions of JAVA) which had a referenced to “attached fixlets”, but I’m not seeing any attachments to that post.
{ removed old text here… }
Replicating what I have here to see if I can get this nailed down better.
In my case I want to create a .bat file that I can call that will run the msiexec commands as needed (completely bypassing the Powershell script signing issue).
// modify the version number in the next line to affect all versions of JAVA except that version
IF{exists keys whose (value "DisplayName" of it as string as lowercase contains "java" AND (value "Publisher" of it as string as lowercase contains "oracle" OR value "Publisher" of it as string as lowercase contains "sun") AND value "DisplayName" of it as string as lowercase does not contain "java auto updater" AND value "DisplayName" of it as string as lowercase does not contain "java 8 update 199") of keys "hklm\software\microsoft\windows\currentversion\uninstall" of (native registry;registry)}
// note: this may also remove JAVA SE Development Kit. Need to confirm that before applying on any system with the JDK installed
// note also: version number was set to 199 above. There are currently no versions of JAVA Runtime at that level, so this should catch all installed versions at -location redacted- (within -org redacted-)
delete __appendfile
appendfile {concatenation "%0d%0a" of (name of it) of keys whose (value "DisplayName" of it as string as lowercase contains "java" AND (value "Publisher" of it as string as lowercase contains "oracle" OR value "Publisher" of it as string as lowercase contains "sun") AND value "DisplayName" of it as string as lowercase does not contain "java auto updater" AND value "DisplayName" of it as string as lowercase does not contain "java 8 update 199") of keys "hklm\software\microsoft\windows\currentversion\uninstall" of (native registry;registry)}
delete c:\windows\temp\javaUninstall.txt
copy __appendfile c:\windows\temp\javaUninstall.txt
// copy the javaUninstall.txt file to the server logs folder
copy __appendfile \\server\logs\{Computer name}_javaUninstall.txt
endif
delete __createfile
createfile until EOF
for /F %%A in ("c:\windows\temp\javaUninstall.txt") do @echo "msiexec.exe -ArgumentList /x %%A /qn REBOOT=ReallySuppress -wait -passthru" >> "c:\windows\temp\JavaUninstall.bat"
EOF
delete c:\windows\temp\javaUninstall-loop.bat
delete c:\windows\temp\javaUninstall.bat
copy __createfile c:\windows\temp\javaUninstall-loop.bat
copy __createfile \\server\logs\{Computer name}_javaUninstall.bat
runhidden cmd /K c:\windows\temp\javaUninstall.bat
I was expecting and hoping that I had this worked out at this point, but seemingly I don’t 
I tried to run the script and it failed in the code, somewhere after it created the text file for me. (It would appear to have failed at the point that the file for the JavaUninstall-Loop.bat file should be getting created, in the createfile until EOF area
I’m gonna work on some more troubleshooting to see if I can figure this out, but appreciate suggestions and input.