📜 VBScript (WSH)

Disable Lock Screen Notifications (VBScript)

Stops app notifications from appearing on the lock screen. Applies the tweak via WScript.Shell.RegWrite.

By WindowsScripting.com · 751 B
SetDisableLockScreenNotifications.vbs
' ============================================================
' SetDisableLockScreenNotifications.vbs
'
' Disable Lock Screen Notifications.
' Stops app notifications from appearing on the lock screen.
'
' Usage: cscript SetDisableLockScreenNotifications.vbs
' ============================================================

Option Explicit

Dim objShell
Set objShell = CreateObject("WScript.Shell")

On Error Resume Next
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\PushNotifications\LockScreenToastEnabled", 0, "REG_DWORD"

If Err.Number = 0 Then
    WScript.Echo "Disable Lock Screen Notifications applied."
Else
    WScript.Echo "Failed to apply tweak (Error " & Err.Number & ": " & Err.Description & ")"
End If
On Error Goto 0