@echo off

net session >nul 2>&1
if %errorlevel% neq 0 (
    echo Starte mit Administratorrechten...
    powershell -Command "Start-Process cmd -ArgumentList '/c \"%~f0\"' -Verb RunAs"
    exit /b
)

echo Setze Registry-Eintrag...

powershell -NoProfile -ExecutionPolicy Bypass -Command "New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services\Client' -Force | Out-Null; New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services\Client' -Name 'RedirectionWarningDialogVersion' -Value 1 -PropertyType DWord -Force | Out-Null"

echo.
echo Fertig!
pause