I'm trying to create a basic script to uninstall an application across all our endpoints using cmd;
msiexec /quiet /norestart /uninstall {xxxx-xxx-xxx-xxxx-xxxxx}
Due to different versions, the same app may have multiple GUIDs on different endpoints
How can I run the wmic product get name,IdentifyingNumber cmdlet to search for a specific application and set it's GUID also to a variable?
wmic product get name,IdentifyingNumber"
IdentifyingNumber Name
{E8CAD3B5-7016-45AE-97DF-098B5C8D4AC8} App1
{90160000-008C-0000-1000-0000000FF1CE} App
I can find and match the Application to a variable, bit is struggling setting the GUID to a variable.
FOR /F "tokens=2 delims==" %%A IN ('WMIC product GET Name /VALUE ^| FIND /I "App1"') DO SET _application=%%A
ECHO Application: "%_application%"
Rem ECHO GUID:%_GUIDVALUE% //Matching Application GUID
Any help would appreciated