ЛайвХак с Anydesk
Добавлено: 13 окт 2022, 10:43
Код: Выделить всё
@echo off
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --get-id') do set OLD_ID=%%i
echo Stopping anydesk
echo.
net stop anydesk
taskkill /f /im AnyDesk.exe
echo Erasing conf file, rename users
echo.
del /Q /F "%ProgramData%\AnyDesk\service.conf"
ren "%userprofile%\AppData\Roaming\AnyDesk\user.conf" "user.conf2"
ren "%userprofile%\AppData\Roaming\AnyDesk\thumbnails" "thumbnails2"
echo wait to get new ID
net start AnyDesk
timeout 2
:wait
for /f "delims=" %%i in ('"C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --get-id') do set ID=%%i
if not %OLD_ID%==%ID% goto nowait
echo OLD ID = NEW ID. Check Internet and wait for new ID
timeout 10
goto wait
:nowait
echo restoring old contacts
net stop anydesk
del "%userprofile%\AppData\Roaming\AnyDesk\user.conf"
ren "%userprofile%\AppData\Roaming\AnyDesk\user.conf2" "user.conf"
ren "%userprofile%\AppData\Roaming\AnyDesk\thumbnails2" "thumbnails"
echo Starting anydesk.
echo.
net start AnyDesk
set PASS=ПАРОЛЬ
echo.
echo %PASS% | "C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --set-password
echo anydesk id %ID%
echo anydesk pass %PASS%
pause
start "" "C:\Program Files (x86)\AnyDesk\AnyDesk.exe"