title: Find String and assign a variable in a Batch Script
body: <p>I am sure this is an easy one for you guys but I have been struggling with it.</p>
  <p>The following code will go through the WMIC and export the line to a txt file then Set the var as Y
  Here is where I am lost.
  I need to set it up so if it exist, it will assign a variable to the entire line that was exported
  Example: Microsoft Office Professional Plus 2016                                  16.0.4266.1001</p>
  <p>So that when the entire script is done, I man make command window pop up that says:
  Microsoft Office Professional Plus 2016                                  16.0.4266.1001
  if installed and if not, the variable will say &quot;Not installed.&quot;
  This is to run on new laptops as a checking tool.</p>
  <p>Thanks everyone</p>
  <pre><code>  @ Echo off
  del C:\Temp\Cylance.txt
  wmic product get name,version | find &quot;Cisco AnyConnect Secure&quot;&gt;&gt;c:\temp\Cylance.txt &amp; SET CISCO=Y
  wmic product get name,version | find &quot;Microsoft Office Professional&quot;&gt;&gt;c:\temp\Cylance.txt &amp; sET Office=Y
  wmic product get name,version | find &quot;Microsoft Edge&quot;&gt;&gt;c:\temp\Cylance.txt &amp; Set Edge=Y
  wmic product get name,version | find &quot;Cylance Unified Agent&quot;&gt;&gt;c:\temp\Cylance.txt &amp; Set Cylance=Y
  wmic product get name,version | find &quot;Java&quot;&gt;&gt;c:\temp\Cylance.txt &amp; Set Java=Y
  wmic product get name,version | find &quot;MultiPresenter&quot;&gt;&gt;c:\temp\Cylance.txt &amp; Set Multi=Y
  
  Echo %Cisco%
  Echo %Office%
  Echo %Edge%
  Echo %Cylance%
  Echo %Java%
  Echo %Multi%
  Pause
  </code></pre>