' ============================================================
' CheckDisableCortanaStatus.vbs
'
' Checks whether "Disable Cortana" is currently applied.
'
' Usage: cscript CheckDisableCortanaStatus.vbs
' ============================================================

Option Explicit

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

On Error Resume Next
currentValue = objShell.RegRead("HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search\AllowCortana")

If Err.Number <> 0 Then
    WScript.Echo "'AllowCortana' is not set (using the Windows default)."
Else
    WScript.Echo "Current value of 'AllowCortana': " & currentValue
End If
On Error Goto 0