Auto-commit: 2025-10-31 08:59:02
This commit is contained in:
22
Packages/RegistryOnHKLM/DisableWPAD.ps1
Normal file
22
Packages/RegistryOnHKLM/DisableWPAD.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$isOS64 = [Environment]::Is64BitOperatingSystem
|
||||
$isProc64 = [Environment]::Is64BitProcess
|
||||
|
||||
$KeyPS = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp'
|
||||
$KeyRel = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp'
|
||||
$Name = 'DisableWpad'
|
||||
|
||||
if ($isOS64 -and -not $isProc64) {
|
||||
# 32-bit PowerShell on 64-bit OS -> write to 64-bit registry view
|
||||
$bk = [Microsoft.Win32.RegistryKey]::OpenBaseKey(
|
||||
[Microsoft.Win32.RegistryHive]::LocalMachine,
|
||||
[Microsoft.Win32.RegistryView]::Registry64
|
||||
)
|
||||
$k = $bk.CreateSubKey($KeyRel)
|
||||
$k.SetValue($Name, 1, [Microsoft.Win32.RegistryValueKind]::DWord)
|
||||
$k.Close()
|
||||
} else {
|
||||
if (-not (Test-Path -LiteralPath $KeyPS)) { New-Item -Path $KeyPS -Force | Out-Null }
|
||||
New-ItemProperty -Path $KeyPS -Name $Name -Value 1 -PropertyType DWord -Force | Out-Null
|
||||
}
|
||||
10
Packages/RegistryOnHKLM/readme.md
Normal file
10
Packages/RegistryOnHKLM/readme.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 🧩 HKLM Registry Write (64-bit)
|
||||
|
||||
## 🔧 What it does
|
||||
- Opens **HKLM** in the **64-bit registry view**.
|
||||
- Creates/opens subkey
|
||||
- Sets value
|
||||
|
||||
## ✅ Prerequisites
|
||||
- Run as **Administrator**.
|
||||
- Writes to the **64-bit** hive; use `Registry32` if you need the 32-bit view.
|
||||
Reference in New Issue
Block a user