When I ran the script created by the policy, it ran successfully (so it said), but inventory showed iTunes still installed. Bummer.
So I turned to the old standby, VBScript to uninstall it.
Here it is if anyone needs it:
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set WshShell = CreateObject("wscript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
strDisplayName = WshShell.RegRead ("HKLM\" & strKeyPath & "\" & subkey & "\DisplayName")
If strDisplayName = "iTunes" Then
WshShell.Run "msiexec.exe /X " & SubKey & " /qn", 7, True
End If
Next
Comments