How to create Fixlet of a command line

I have a working command that runs properly in command prompt but I can’t get it to work in a fixlet

WMIC product where "Name LIKE '%Java%'" call uninstall

tried the following in a fixlet. it doesn’t uninstall anything but it says fixed since successful completion of all lines in actionscript

delete __createfile
delete run.bat
createfile until _end_
WMIC product where "Name LIKE '%Java%'" call uninstall /nointeractive
_end_
move __createfile run.bat
wait run.bat

Is there a reason you are using a batch script rather than simply running the command in the fixlet itself?

wait "WMIC product where "Name LIKE '%Java%'" call uninstall /nointeractive"
2 Likes

That said, from what I see it looks like it ran correctly using what you had…

STATUS: Running action…
Command succeeded delete No ‘D:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__FixletDebugger__createfile’ exists to delete, no failure reported
Command succeeded delete No ‘D:\Program Files (x86)\BigFix Enterprise\BES Client__BESData__FixletDebugger\run.bat’ exists to delete, no failure reported
Command succeeded createfile until
Command succeeded move __createfile run.bat
Command started - wait run.bat
Command succeeded (Exit Code=0) wait run.bat

— Result —
Evaluation completed successfully!

You could use the fixlet debugger to help with this too

1 Like

my bigfix action will say the same thing…successful completion but the java installs still show in control panel. when I run the single command in cmd prompt it will actually uninstall all java versions installed on the machine

here is a pic of running a .bat file I created and manually ran on the machine. it says it can’t find an instance but if i ran the same exact command directly in cmd prmpt it will find installs and uninstall them. something changes or it doesn’t interpret the same when running in a .bat file or actionscript…
image

In a batch file, %JAVA% would evaluate as an environment variable named JAVA (no such variable exists). Try using %%Java%% to pass literal % signs.

1 Like

thanks I was able to get it working.
1-created batch file with single command line
WMIC product where "Name LIKE '%%Java%%'" call uninstall
2-created software distribution management package, uploaded the file, created task with command line
nameoffile.bat
3-fixlet works removing all java versions 32 or 64 bit