As Microsoft continues to evolve Windows 10 thru each "Update" every 6 months, things change! I have found that customers need to be aware of those Apps that get installed via the App Store and those Apps may not be displayed in the traditional "Programs and Features" via the Control Panel. In addition, the ability to Uninstall these Apps become more difficult and they do not always complete uninstall using the "Programs and Features" but have more success using the "Apps and Features".
I will be providing both, the ability to collect all the items in "Apps and Features" via Custom Inventory and the Uninstall command to remove those Apps listed.
First, let's review the "Apps and Features". Access this using the Start Button and type in "Apps". Select "Apps and Features":
Be aware, some apps listed are not available to be uninstalled such as "Camera" for Laptops so equipped.
By using a WMIC query in a Command Window, a complete list can be produced. Here is the query: wmic product get name
Adding the function to print to a file looks like this: wmic product get name > C:\BCM\Products.log
Once it is output to a file, use the Op Rule step to parse the file: File Analysis via Regular Expression. Screen shot of the configuration of the step below:
For those not familiar with Regular Expression, I will try to explain why I used the expression I did.
When piping data from the Command Line the data written to the text file was formatted with lots of spaces and a Carriage Return (New Line). I needed to find an expression that remove all those additional spaces so I was not adding that to BCM Custom Data. This expression, ^(.*\b.), translated does this:
^ = Beginning of line
( )= Anything in Parentheses is Captured
. = Wild Card for Any Single Character
* = Wild Card for ALL Training Characters
\b= End of a Word Boundary (Last word on that row and limited to Alpha Characters)
.= Adds one additional Character. Some entries had Closing Parentheses and that was not captured so needed to add the period. This should not be problematic.
I pasted the results of Products.log file into a Word Doc and configured Word to "SHOW" all formatting to reveal all those training spaces.
Here is the Op Rule I created with the various Steps (Click on Image to enlarge):
Results of this Rule:
Unfortunately, This does not return every item listed in the GUI. For example, I have GoTo Opener and GoTo Meeting 10.1.1.15160 listed in GUI but not in this output list. These two items are listed in the control panel and so they will be listed in BCM Software Inventory.
Finally, the ability to run a command line to uninstall any item in the control panel or the Apps List:
wmic product where name=”name of program” call uninstall.
I am almost certain the CALL function will run through the registry and then pull the uninstall value regardless if 32 or 64 application and regardless if it was installed using a MSI installer of not. This should make it more simple to run uninstall steps. I tested this yesterday with a customer and only one change needed to be made. BCM uses quotes so if spaces are in your folder path it accounts for those. You must replace the double quotes with single quotes. So the string you would enter into the "Execute Program" step to uninstall iTunes would be:
wmic product where name='iTunes' call uninstall /nointeractive
This worked great for uninstalling iTunes but testing is still in order to verify before running on multiple devices.
For those Apps with special characters or you want to remove apps with various version numbers you can use the "LIKE" function. Example:
wmic product where name like=7-zip%' call uninstall /nointeractive (this method would uninstall any version of 7-zip on the targeted device(s)).
If the App requires a reboot after uninstalling and you wish to suppress I found this too:
wmic product where name='iTunes' call uninstall /nointeractive |wmic && shutdown /a
I have attached the Op Rule I used to Collect Apps in Custom Inventory. Reply to this post if you have any additional information about this process that would assist others.
Collect All Apps.xml 12.4 K