Skip to content

Instantly share code, notes, and snippets.

@SimonSeider
Last active May 14, 2026 03:22
Show Gist options
  • Select an option

  • Save SimonSeider/b8fd01daed6dba109946201a40a2c306 to your computer and use it in GitHub Desktop.

Select an option

Save SimonSeider/b8fd01daed6dba109946201a40a2c306 to your computer and use it in GitHub Desktop.
block-vlc.ps1
$base = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
# we enable the DisallowRun policy for the current user
New-Item -Path $base -Force | Out-Null
New-ItemProperty -Path $base -Name "DisallowRun" -PropertyType DWord -Value 1 -Force | Out-Null
# we create the application block list container
$block = Join-Path $base "DisallowRun"
New-Item -Path $block -Force | Out-Null
# we block VLC executable explicitly
New-ItemProperty -Path $block -Name "1" -PropertyType String -Value "vlc.exe" -Force | Out-Null
# we refresh Explorer so policy applies immediately
Stop-Process -Name explorer -Force
Start-Process explorer.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment