I created a fixlet to uninstall a software from windows machine the command works from the command line but fails to uninstall the application through the fixlet.
Command line:
wiathidden cmd /C wmic product where “name like ‘%JAVA%’” call uninstall
I read through this page: How to create Fixlet of a command line
Then tried it using %%JAVA%% but that did not help, I’m not planning to use .bat file and like to keep the process within the fixlet only.
Sorry for the typo I misspelled it as I was typing this post but it’s correct in the fixlet. I tried to run you provided but still not working for me through BigFix yet it works from cmd.
I wouldn’t have expected your command to work, since the cmd shell should interpret %JAVA% as an environment variable.
Something you could try would be
action uses wow64 redirection {not x64 of operating system}
waithidden cmd /C wmic product where "name like '%%JAVA%%'" call uninstall
However I’ve not much used the WMIC method for uninstalling applications. Does this run a silent uninstall (no pop-up messages that need to be acknowledged by the user?)
If you run
cmd /C wmic product where "name like '%%JAVA%%'" call uninstall
from the command line, does it work as expected?
My memory of CMD shell handling of a %VARIABLE% appears to be incorrect. I expected it to treat %JAVA% as a variable reference and evaluate it as nothing (or, if %JAVA% was defined in the shell, to whatever the value was).
But it seems the shell does pass it along literally if %JAVA% is not defined as an environment variable.
My mistake, actually, I thought the cmd shell would interpret %JAVA% as an empty shell variable, but apparently it does not, assuming %JAVA% is not set as a variable
Testing on my system, the following actionscript is working as expected to remove Oracle JDK 21:
action uses wow64 redirection {not x64 of operating system}
waithidden cmd /C wmic product where "name like '%JAVA%'" call uninstall
@S2S, if yours is not working, try posting the snippet of the BES Client Log from this action. I’d also suggest building this as a batch file so you can capture any error messages from the shell.
I’ve also tested that this works to remove Oracle JDK 21, no dialogs are presented to the user, and it generates the c:\windows\temp\output.log file with this content:
C:\BES\Client\__BESData\actionsite>wmic product where "name like '%JAVA%'" call uninstall
Executing (\\WIN11\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{8D4CF14F-F1A6-576C-AE82-5F90CC628632}",Name="Java(TM) SE Development Kit 21 (64-bit)",Version="21.0.0.0")->Uninstall()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 0;
};
wmic product where “name like ‘%%SOME_APP%%’” call uninstall
works perfectly from the command line but not when I run it from bigfix fixlet, I does work on some of the installations and successfully uninstall them and leave others untouched unlike the cmd which completely removes all the deployments.
Something different about your app, then. As I said mine worked with 64-bit JDK 21. What Java, what version, what architecture, are you trying to remove?
How about where I illustrated using a batch file to save the output log? What’s in the output?
@JasonWalker the intent is to use the fixlet to uninstall other applications as well such as putty, I think this is an easier and faster example to demonstrate the issue. Try to install multiple versions of putty 0.78 and 0.79 for x86 and x64 on a x64 system so will end up with a total of 4 installations. If you run the uninstallation using wmic from cmd it will remove all 4 from the system, while running the same exact command from bigfix will only remove 0.79 and leave both 0.78 (x86, x64) untouched, I checked the log file when that happened and it logged “No Instance(s) Available.”
cmd:
wmic product where “name like ‘%%putty%%’” call uninstall