Attribute VB_Name = "DisableAutoplayAllDrivesRegSet"
Option Explicit

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

    Set wsh = CreateObject("WScript.Shell")
    regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun"

    wsh.RegWrite regPath, 255, "REG_DWORD"

    MsgBox "Disable Autoplay for All Drives applied." & vbCrLf & regPath, vbInformation
End Sub