@echo off
for /f "tokens=2* delims= " %%a in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "DisablePreviewWindow" 2^>nul') do (
    set "value=%%b"
)

echo "value = %value%"
if not "%value%"=="0x1" (
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V DisablePreviewWindow /T REG_DWORD /D 1 /F
    REG ADD "HKCU\SOFTWARE\Microsoft\Windows\DWM" /V EnableAeroPeek /T REG_DWORD /D 0 /F
)