' ============================================================
' CheckDisableWindowsSpotlightStatus.vbs
'
' Checks whether "Disable Windows Spotlight on Desktop" is currently applied.
'
' Usage: cscript CheckDisableWindowsSpotlightStatus.vbs
' ============================================================

Option Explicit

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

On Error Resume Next
currentValue = objShell.RegRead("HKCU\Software\Policies\Microsoft\Windows\CloudContent\DisableSpotlightCollectionOnDesktop")

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