@echo off
set RUSTDESK="C:\Program Files\RustDesk\rustdesk.exe"
taskkill /f /im rustdesk.exe >nul 2>&1
net stop RustDesk >nul 2>&1
timeout /t 2 >nul
rd /s /q "C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk"
rd /s /q "%AppData%\RustDesk"
timeout /t 2 >nul
:: Создаем папку конфига
mkdir "C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config" >nul 2>&1
:: Создаем конфиг
(
echo [options]
echo custom-rendezvous-server = "155.212.245.106"
echo relay-server = "155.212.245.106"
echo key = "kh7K8SXhwXmtmKdvtNEQDP1mZr7oQSDOnbFhxBByLCk="
echo approve-mode = "password"
echo verification-method = "use-permanent-password"
echo allow-remote-config-modification = "Y"
echo enable-unsecure-tls = "Y"
) > "C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk2.toml"
timeout /t 1 >nul
:: Запуск службы
net start RustDesk >nul 2>&1
timeout /t 5 >nul
:: Ставим постоянный пароль
%RUSTDESK% --password "Lemon.3712"
timeout /t 2 >nul
:: Перезапуск клиента
taskkill /f /im rustdesk.exe >nul 2>&1
timeout /t 2 >nul
start "" %RUSTDESK%
echo Done
pause