WMIC GET /Value

iTeam HelpDesk
iTeam HelpDesk used Ask the Experts™
on
I am attempting to use WMIC to obtain the value ONLY for a program like:
wmic product "Symantec Endpoint Protection" get identifyingnumber /value

But this command gives me "identifyingnumber=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

How do I get just the value without the "identifyingnumber" in its return.  My goal is to take that value and attach it to another script like so.

msiexec.exe /q/x %Identifyingnumber%
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I would look into using powershell

$prod = (gwmi win32_product -Filter "name like 'Symantec Endpoint Protection'")
$prod.IdentifyingNumber

#$prod.Uninstall()

Open in new window

Gabriel CliftonNet Admin
Top Expert 2012

Commented:
You could use a for /f to get what you need.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial