⚡ PowerShell 5.1+

Disable Cortana

Disables Cortana integration in Windows Search (requires admin). Requires an elevated (Administrator) prompt.

By WindowsScripting.com · 710 B
Set-DisableCortana.ps1
<#
.SYNOPSIS
    Disable Cortana.

.DESCRIPTION
    Disables Cortana integration in Windows Search (requires admin). Requires an elevated (Administrator) prompt.

    Sets HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search \ AllowCortana to 0.

.EXAMPLE
    .\Set-DisableCortana.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name 'AllowCortana' -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Disable Cortana applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green