Attribute VB_Name = "DisableTelemetryRegSet"
Option Explicit

Public Sub DisableTelemetryRegSet()
    Dim wsh As Object
    Dim regPath As String

    Set wsh = CreateObject("WScript.Shell")
    regPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection\AllowTelemetry"

    wsh.RegWrite regPath, 0, "REG_DWORD"

    MsgBox "Disable Windows Telemetry applied." & vbCrLf & regPath, vbInformation
End Sub