@echo off
setlocal

set "SCRIPT_DIR=%~dp0"
set "CFGDIR=%APPDATA%\RustDesk\config"

rem Versucht, die Windows-Download-Markierung zu entfernen (falls vorhanden)
for %%F in ("%SCRIPT_DIR%rustdesk.exe" "%SCRIPT_DIR%RustDesk2.toml") do (
  >nul 2>&1 del "%%~fF:Zone.Identifier"
)

mkdir "%CFGDIR%" >nul 2>&1
copy /Y "%SCRIPT_DIR%RustDesk2.toml" "%CFGDIR%\RustDesk2.toml" >nul
>nul 2>&1 del "%CFGDIR%\RustDesk2.toml:Zone.Identifier"

start "" "%SCRIPT_DIR%rustdesk.exe"
endlocal
