Jtracy_ItPro

WebEx_Teams_x64-Detect_PerUser.vbs

Sep 18th, 2020 (edited)
1,640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Detect WebEx Teams x64 - Per User Install (default)
  2. '
  3. ' @Jtracy_ItPro
  4. '
  5. ' this is tested against the MSI.
  6. ' I'm not sure if there's other installers (EXE).
  7. ' I'm not aware if there's any x86 version.
  8. ' - JT
  9.  
  10. ' =-=-==-=-=
  11. ' let's call this 1.1? - JT
  12.  
  13. ' This is designed for a MEMCM detection rule
  14. ' If an app with a matching name is found, it will spit out the name.
  15. ' If not... there is no output.
  16. ' To narrow by architecture, you can exclude or include the appropriate hive.
  17.  
  18. ' This is meant to do exact matches.
  19. ' case sensitive
  20. ' Not version number specific, can be any verison.
  21.  
  22. MyAppName = "Webex Teams"
  23.  
  24. HKEY_LOCAL_MACHINE = &H80000002
  25. HKEY_CURRENT_USER  = &H80000001
  26. UninstallNative = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
  27. UninstallWow32 = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
  28. ProductsNative = "Software\Microsoft\Installer\Products\"
  29.  
  30. Set Reg = GetObject("winmgmts://./root/default:StdRegProv")
  31.  
  32. ' Define the function, to be repeated for each key base
  33.  
  34. Function FindApp (Hive, KeyBase)
  35.  
  36.     Reg.EnumKey Hive, KeyBase, Results
  37.  
  38.     For Each Key in Results
  39.         Reg.GetStringValue Hive, KeyBase & Key, "ProductName", FoundAppName
  40.         If (FoundAppName = MyAppName) Then
  41.             wscript.echo FoundAppName
  42.         End If
  43.     Next
  44.  
  45. End Function
  46.  
  47. ' now run the function
  48. ' per user product search
  49.  
  50. FindApp HKEY_CURRENT_USER, ProductsNative
  51.  
  52.  
Add Comment
Please, Sign In to add comment