-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUninstallTeams.au3
More file actions
36 lines (31 loc) · 1.02 KB
/
Copy pathUninstallTeams.au3
File metadata and controls
36 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Res_Fileversion=1.0.0.10
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#RequireAdmin
#include <Process.au3>
$sUninstall = GetUninstallString("Teams Machine-Wide Installer")
If Not @error Then
$sUninstall = StringReplace($sUninstall, " /I", " /x") & " /qn"
_RunDos($sUninstall)
endif
_RunDos(""""&@LocalAppDataDir&"\Microsoft\Teams\Update.exe"" --uninstall -s")
sleep(4000)
Func GetUninstallString($app)
$key = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall"
Local $i = 0
While 1
$i += 1
$subkey = RegEnumKey($key, $i)
If @error Then ExitLoop
$displayname = RegRead($key & "\" & $subkey, "DisplayName")
If @error Then ContinueLoop
If $displayname == $app Then
Return RegRead($key & "\" & $subkey, "UninstallString")
EndIf
WEnd
SetError(1)
Return ""
EndFunc