title: how can find lync or its upgraded version skype installed in machine using vb script
body: <p>I am in requirement like show warning message to communicator user  saying "install lync ,OCS will decommisioned soon". before dispalying this warning message i need to check the microsoft lync 2013 or its upgrade skype is available in user machine.If both are not available then only message shown to user. </p>
  
  <p>I use below code for checking Lync installaed or not. But message showing to user if they uses skype(upgrade of Lync).</p>
  
  <p>Any help from Experienced hands will be great.</p>
  
  <pre><code>On Error Resume Next
  
  Const HKLM = &amp;H80000002 'HKEY_LOCAL_MACHINE
  
      strComputer = "."
  
      strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
  
      strEntry1a = "DisplayName"
  
      strEntry1b = "QuietDisplayName"
  
      strEntry1c = "DisplayVersion"
  
      strEntry1d = "UninstallString"
  
      IsLyncInstalled = 0 
  
      Set objReg = GetObject("winmgmts://" &amp; strComputer &amp; "/root/default:StdRegProv")
  
      objReg.EnumKey HKLM, strKey, arrSubkeys
      'WScript.Echo "Installed Applications" &amp; VbCrLf
  
      For Each strSubkey In arrSubkeys
  
      intRet1 = objReg.GetStringValue(HKLM, strKey &amp; strSubkey, strEntry1a, strValue1)
  
  if intRet1 &lt;&gt; "" Then
  
  objReg.GetExpandedStringValue HKLM, strKey &amp; strSubkey, strEntry1a, strValue1
  
  intCompare=StrComp("Microsoft Lync 2013",strValue1,vbTextCompare)
  
      IF intCompare = 0 THEN
  
  IsLyncInstalled = 1
  
  WScript.Echo "Microsoft Lync 2013 is  installed on this system" &amp;VbCrLf  &amp;strEntry1a &amp; " : " &amp; strValue1 
  
  
      END IF
  
  End If
  
  Next
  </code></pre>