Created
July 21, 2026 14:51
-
-
Save ChieftainY2k/22e151bb3a6c6a080b069407357d57ec to your computer and use it in GitHub Desktop.
Prevent Win11 from downloading extra software on USB connect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null | |
| Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" ` | |
| -Name "PreventDeviceMetadataFromNetwork" ` | |
| -Type DWord ` | |
| -Value 1 | |
| gpupdate /target:computer /force | |
| Write-Host "Done. Restart Windows to ensure the policy is applied." -ForegroundColor Green |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment