-
Star
(121)
You must be signed in to star a gist -
Fork
(43)
You must be signed in to fork a gist
-
-
Save janasco/c6168d17ed6eb4b6eaf7fd46fb775f60 to your computer and use it in GitHub Desktop.
| @echo off & setlocal enableextensions | |
| title Reset AnyDesk | |
| reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit) | |
| chcp 437 | |
| call :stop_any | |
| del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf" | |
| del /f "%APPDATA%\AnyDesk\service.conf" | |
| copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\" | |
| rd /s /q "%temp%\thumbnails" 2>NUL | |
| xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails" | |
| del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\*" | |
| del /f /a /q "%APPDATA%\AnyDesk\*" | |
| call :start_any | |
| :lic | |
| type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" || goto lic | |
| call :stop_any | |
| move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf" | |
| xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails" | |
| rd /s /q "%temp%\thumbnails" | |
| call :start_any | |
| echo ********* | |
| echo Completed. | |
| echo( | |
| goto :eof | |
| :start_any | |
| sc start AnyDesk | |
| sc start AnyDesk | |
| if %errorlevel% neq 1056 goto start_any | |
| set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe | |
| set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe | |
| if exist "%AnyDesk1%" start "" "%AnyDesk1%" | |
| if exist "%AnyDesk2%" start "" "%AnyDesk2%" | |
| exit /b | |
| :stop_any | |
| sc stop AnyDesk | |
| sc stop AnyDesk | |
| if %errorlevel% neq 1062 goto stop_any | |
| taskkill /f /im "AnyDesk.exe" | |
| exit /b |
i have the same issue like AR 69 above anything doesnt seems to work anymore
can we do this on macos?
i have the same issue like AR 69 above anything doesnt seems to work anymore
Uninstall, change Mac address, run script, reinstall.
Can someone tell me whether the above code or the scripts below work?
https://github.com/henriquelucas/Reset-Licen-a-Anydesk
https://github.com/MKultra6969/AnyDesk-reset
anyone for macos?
Can someone tell me whether the above code or the scripts below work?
https://github.com/henriquelucas/Reset-Licen-a-Anydesk https://github.com/MKultra6969/AnyDesk-reset
They work, use the ones in the comments. I added a post below with all the OS instructions.
Windows Instructions:
open terminal or cmd type notepad anydeskreset.bat
Paste the following, and after Run the batch file by double clicking or right click run as administrator.
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
@echo off & setlocal enableextensions
title Reset AnyDesk
reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit)
chcp 437
call :stop_any
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf"
del /f "%APPDATA%\AnyDesk\service.conf"
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\"
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails"
del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\*"
del /f /a /q "%APPDATA%\AnyDesk\*"
call :start_any
:lic
type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" || goto lic
call :stop_any
move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf"
xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails"
rd /s /q "%temp%\thumbnails"
call :start_any
echo *********
echo Completed.
echo(
goto :eof
:start_any
sc start AnyDesk
sc start AnyDesk
if %errorlevel% neq 1056 goto start_any
set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe
set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe
if exist "%AnyDesk1%" start "" "%AnyDesk1%"
if exist "%AnyDesk2%" start "" "%AnyDesk2%"
exit /b
:stop_any
sc stop AnyDesk
sc stop AnyDesk
if %errorlevel% neq 1062 goto stop_any
taskkill /f /im "AnyDesk.exe"
exit /b
Linux instructions:
Open terminal
#use ifconfig to determine your wlan interface and use below to set random and permanent
Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc.
ifconfig
sudo ifconfig your-interface-from-ifconfig down
sudo apt -y install macchanger
sudo macchanger -r -b your-interface-from-ifconfig
sudo ifconfig your-interface-from-ifconfig up
rm -rf ~/.anydesk
sudo apt autopurge anydesk -y
sudo apt -y install anydesk
To make a shortcut to the script, sudo pico /sbin/resetanydesk and paste code above.
change the wlan interface and save to /sbin/resetanydesk by pressing ctrl +o in pico then ctrl +x to exit, then run
chmod +x /sbin/resetanydesk and run resetanydesk
MacOS:
Quit Anydesk
Remove Anydesk from Applications folder
Open terminal
type:
mv ~/.anydesk ~/.anydesk.old
rm -rf ~/.anydesk
sudo sh -c "curl https://raw.githubusercontent.com/shilch/macchanger/master/macchanger.sh > /usr/local/bin/macchanger && chmod +x /usr/local/bin/macchanger"
route -n get default | grep interface
sudo macchanger -r - p your-interface-name-from-previous-step
Download, install and Start Any desk (if it shows no id or the id is 0) then do a Logout from your MacOS user
Login again and start Anydesk
to revert changes
rm -rf ~/.anydesk
mv ~/.anydesk.old ~/.anydesk
boa tarde galera, não consigo tirar o 999 segundos do Anydesk de jeito nenhum fiz de tudo, apaguei na pasta progam data, nos registro e nada
boa tarde galera, não consigo tirar o 999 segundos do Anydesk de jeito nenhum fiz de tudo, apaguei na pasta progam data, nos registro e nada
boa tarde galera, não consigo tirar o 999 segundos do Anydesk de jeito nenhum fiz de tudo, apaguei na pasta progam data, nos registro e nada
Aqui eu faço da seguinte maneira, uso a versão 5.5.3, ela não dá banimento.
Windows Instructions:
open terminal or cmd type notepad anydeskreset.bat
Paste the following, and after Run the batch file by double clicking or right click run as administrator.
:: BatchGotAdmin :------------------------------------- REM --> Check for permissions IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" ) ELSE ( >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" ) REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params= %* echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" @echo off & setlocal enableextensions title Reset AnyDesk reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit) chcp 437 call :stop_any del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf" del /f "%APPDATA%\AnyDesk\service.conf" copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\" rd /s /q "%temp%\thumbnails" 2>NUL xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails" del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\*" del /f /a /q "%APPDATA%\AnyDesk\*" call :start_any :lic type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" || goto lic call :stop_any move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf" xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails" rd /s /q "%temp%\thumbnails" call :start_any echo ********* echo Completed. echo( goto :eof :start_any sc start AnyDesk sc start AnyDesk if %errorlevel% neq 1056 goto start_any set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe if exist "%AnyDesk1%" start "" "%AnyDesk1%" if exist "%AnyDesk2%" start "" "%AnyDesk2%" exit /b :stop_any sc stop AnyDesk sc stop AnyDesk if %errorlevel% neq 1062 goto stop_any taskkill /f /im "AnyDesk.exe" exit /bLinux instructions:
Open terminal
#use ifconfig to determine your wlan interface and use below to set random and permanent Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc. ifconfig sudo ifconfig your-interface-from-ifconfig down sudo apt -y install macchanger sudo macchanger -r -b your-interface-from-ifconfig sudo ifconfig your-interface-from-ifconfig up rm -rf ~/.anydesk sudo apt autopurge anydesk -y sudo apt -y install anydeskTo make a shortcut to the script,
sudo pico /sbin/resetanydeskand paste code above. change the wlan interface and save to /sbin/resetanydesk by pressing ctrl +o in pico then ctrl +x to exit, then runchmod +x /sbin/resetanydesk and run resetanydeskMacOS:
Quit Anydesk Remove Anydesk from Applications folder
Open terminal type:
mv ~/.anydesk ~/.anydesk.old rm -rf ~/.anydesk sudo sh -c "curl https://raw.githubusercontent.com/shilch/macchanger/master/macchanger.sh > /usr/local/bin/macchanger && chmod +x /usr/local/bin/macchanger" route -n get default | grep interface sudo macchanger -r - p your-interface-name-from-previous-stepDownload, install and Start Any desk (if it shows no id or the id is 0) then do a Logout from your MacOS user
Login again and start Anydesk
to revert changes rm -rf ~/.anydesk mv ~/.anydesk.old ~/.anydesk
it does not work on MacOS. The ID was changed but still get the license notification.
#use ifconfig to determine your wlan interface and use below to set random and permanent
Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc.
ifconfig
sudo ifconfig your-interface-from-ifconfig down
sudo apt -y install macchanger
sudo macchanger -r -b your-interface-from-ifconfig
sudo ifconfig your-interface-from-ifconfig up
rm -rf ~/.anydesk
sudo apt autopurge anydesk -y
sudo apt -y install anydesk
still works, but i did with my wired connection ensp2n0
Windows Instructions:
open terminal or cmd type notepad anydeskreset.bat
Paste the following, and after Run the batch file by double clicking or right click run as administrator.:: BatchGotAdmin :------------------------------------- REM --> Check for permissions IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" ) ELSE ( >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" ) REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params= %* echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" @echo off & setlocal enableextensions title Reset AnyDesk reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit) chcp 437 call :stop_any del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf" del /f "%APPDATA%\AnyDesk\service.conf" copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\" rd /s /q "%temp%\thumbnails" 2>NUL xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails" del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\*" del /f /a /q "%APPDATA%\AnyDesk\*" call :start_any :lic type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" || goto lic call :stop_any move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf" xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails" rd /s /q "%temp%\thumbnails" call :start_any echo ********* echo Completed. echo( goto :eof :start_any sc start AnyDesk sc start AnyDesk if %errorlevel% neq 1056 goto start_any set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe if exist "%AnyDesk1%" start "" "%AnyDesk1%" if exist "%AnyDesk2%" start "" "%AnyDesk2%" exit /b :stop_any sc stop AnyDesk sc stop AnyDesk if %errorlevel% neq 1062 goto stop_any taskkill /f /im "AnyDesk.exe" exit /bLinux instructions:
Open terminal#use ifconfig to determine your wlan interface and use below to set random and permanent Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc. ifconfig sudo ifconfig your-interface-from-ifconfig down sudo apt -y install macchanger sudo macchanger -r -b your-interface-from-ifconfig sudo ifconfig your-interface-from-ifconfig up rm -rf ~/.anydesk sudo apt autopurge anydesk -y sudo apt -y install anydeskTo make a shortcut to the script,
sudo pico /sbin/resetanydeskand paste code above. change the wlan interface and save to /sbin/resetanydesk by pressing ctrl +o in pico then ctrl +x to exit, then runchmod +x /sbin/resetanydesk and run resetanydesk
MacOS:
Quit Anydesk Remove Anydesk from Applications folder
Open terminal type:mv ~/.anydesk ~/.anydesk.old rm -rf ~/.anydesk sudo sh -c "curl https://raw.githubusercontent.com/shilch/macchanger/master/macchanger.sh > /usr/local/bin/macchanger && chmod +x /usr/local/bin/macchanger" route -n get default | grep interface sudo macchanger -r - p your-interface-name-from-previous-stepDownload, install and Start Any desk (if it shows no id or the id is 0) then do a Logout from your MacOS user
Login again and start Anydesk
to revert changes rm -rf ~/.anydesk mv ~/.anydesk.old ~/.anydeskit does not work on MacOS. The ID was changed but still get the license notification.
anyone for macos?
If you are on a Mac... Use the Screen Sharing App located in the Utilities folder... Don't have to use AnyDesk or any other...
Linux instructions:
#use ifconfig to determine your wlan interface and use below to set random and burned in
sudo ifconfig wlp2s0 down sudo apt -y install macchanger sudo macchanger -r -b wlp2s0 sudo ifconfig wlp2s0 up rm -rf ~/.anydesk sudo apt autopurge anydesk -y sudo apt -y install anydesk
#save to /sbin/resetanydesk then chmod +x /sbin/resetanydesk and run resetanydesk
This will wipe your settings and hosts, if you want to save them: mv ~/.anydesk ~/.anydesk.old
I believe this no longer works, Im not on a wlan but on ethernet, not sure if that makes a difference though, Anydevk v7.1.0-1
#use ifconfig to determine your wlan interface and use below to set random and permanent Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc.
ifconfig sudo ifconfig your-interface-from-ifconfig down sudo apt -y install macchanger sudo macchanger -r -b your-interface-from-ifconfig sudo ifconfig your-interface-from-ifconfig up rm -rf ~/.anydesk sudo apt autopurge anydesk -y sudo apt -y install anydesk
still works, but i did with my wired connection ensp2n0
Windows Instructions:
open terminal or cmd type notepad anydeskreset.bat
Paste the following, and after Run the batch file by double clicking or right click run as administrator.:: BatchGotAdmin :------------------------------------- REM --> Check for permissions IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" ) ELSE ( >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" ) REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params= %* echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" @echo off & setlocal enableextensions title Reset AnyDesk reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit) chcp 437 call :stop_any del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf" del /f "%APPDATA%\AnyDesk\service.conf" copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\" rd /s /q "%temp%\thumbnails" 2>NUL xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails" del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\*" del /f /a /q "%APPDATA%\AnyDesk\*" call :start_any :lic type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" || goto lic call :stop_any move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf" xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails" rd /s /q "%temp%\thumbnails" call :start_any echo ********* echo Completed. echo( goto :eof :start_any sc start AnyDesk sc start AnyDesk if %errorlevel% neq 1056 goto start_any set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe if exist "%AnyDesk1%" start "" "%AnyDesk1%" if exist "%AnyDesk2%" start "" "%AnyDesk2%" exit /b :stop_any sc stop AnyDesk sc stop AnyDesk if %errorlevel% neq 1062 goto stop_any taskkill /f /im "AnyDesk.exe" exit /bLinux instructions:
Open terminal#use ifconfig to determine your wlan interface and use below to set random and permanent Replace your-interface-from-ifconfig with your interface name usually wlp3s0 wlan0, wlp0s0, etc. ifconfig sudo ifconfig your-interface-from-ifconfig down sudo apt -y install macchanger sudo macchanger -r -b your-interface-from-ifconfig sudo ifconfig your-interface-from-ifconfig up rm -rf ~/.anydesk sudo apt autopurge anydesk -y sudo apt -y install anydeskTo make a shortcut to the script,
sudo pico /sbin/resetanydeskand paste code above. change the wlan interface and save to /sbin/resetanydesk by pressing ctrl +o in pico then ctrl +x to exit, then runchmod +x /sbin/resetanydesk and run resetanydesk
MacOS:
Quit Anydesk Remove Anydesk from Applications folder
Open terminal type:mv ~/.anydesk ~/.anydesk.old rm -rf ~/.anydesk sudo sh -c "curl https://raw.githubusercontent.com/shilch/macchanger/master/macchanger.sh > /usr/local/bin/macchanger && chmod +x /usr/local/bin/macchanger" route -n get default | grep interface sudo macchanger -r - p your-interface-name-from-previous-stepDownload, install and Start Any desk (if it shows no id or the id is 0) then do a Logout from your MacOS user
Login again and start Anydesk
to revert changes rm -rf ~/.anydesk mv ~/.anydesk.old ~/.anydeskit does not work on MacOS. The ID was changed but still get the license notification.
Pinging you also as you mentioned some linux support in your comment :), this seems to no longer work as per my above comment
Goes into endless loop:
`[SC] OpenService FAILED 1060:
The specified service does not exist as an installed service.`
@echo off
setlocal enableextensions
title Reset AnyDesk ID
:: 1. Verificar permisos de Administrador
reg query HKEY_USERS\S-1-5-19 >NUL || (
echo Por favor, ejecuta este archivo como Administrador.
pause
exit
)
chcp 437 >NUL
echo Deteniendo AnyDesk...
call :stop_any
echo Realizando copia de seguridad de configuracion de usuario...
:: Borra ID antigua
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf" 2>NUL
del /f "%APPDATA%\AnyDesk\service.conf" 2>NUL
del /f "%ALLUSERSPROFILE%\AnyDesk\system.conf" 2>NUL
del /f "%APPDATA%\AnyDesk\system.conf" 2>NUL
:: Backup de preferencias y miniaturas
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%" >NUL 2>NUL
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails" >NUL 2>NUL
:: Limpieza de archivos
del /f /a /q "%ALLUSERSPROFILE%\AnyDesk\ad_" 2>NUL
del /f /a /q "%APPDATA%\AnyDesk\ad_" 2>NUL
echo Reiniciando AnyDesk para generar nueva ID...
call :start_any
:: Espera a que se genere el archivo de sistema con la nueva ID
:lic
timeout /t 2 /nobreak >NUL
if exist "%ALLUSERSPROFILE%\AnyDesk\system.conf" (
type "%ALLUSERSPROFILE%\AnyDesk\system.conf" | find "ad.anynet.id=" >NUL
if !errorlevel! equ 0 goto restore
)
if exist "%APPDATA%\AnyDesk\system.conf" (
type "%APPDATA%\AnyDesk\system.conf" | find "ad.anynet.id=" >NUL
if !errorlevel! equ 0 goto restore
)
:: Si tarda mucho, salimos del bucle para no congelar
goto restore
:restore
echo Restaurando configuracion de usuario...
call :stop_any
move /y "%temp%\user.conf" "%APPDATA%\AnyDesk\user.conf" >NUL 2>NUL
xcopy /c /e /h /r /y /i /k "%temp%\thumbnails" "%APPDATA%\AnyDesk\thumbnails" >NUL 2>NUL
rd /s /q "%temp%\thumbnails" >NUL 2>NUL
echo Iniciando AnyDesk final...
call :start_any
echo *********
echo Completado.
echo(
pause
goto :eof
:: FUNCIONES
:start_any
:: Intenta iniciar servicio (si existe)
sc start AnyDesk >NUL 2>NUL
:: Busca ejecutables comunes
set AnyDesk1=%SystemDrive%\Program Files (x86)\AnyDesk\AnyDesk.exe
set AnyDesk2=%SystemDrive%\Program Files\AnyDesk\AnyDesk.exe
if exist "%AnyDesk1%" start "" "%AnyDesk1%"
if exist "%AnyDesk2%" start "" "%AnyDesk2%"
exit /b
:stop_any
:: Intenta detener servicio (sin bucle infinito)
sc stop AnyDesk >NUL 2>NUL
:: Mata el proceso forzosamente por si es portable
taskkill /f /im "AnyDesk.exe" >NUL 2>NUL
exit /b
This file worked for me




All methods doesn't seem to work any more for me.
I used to just delete the following two files:
"C:\ProgramData\AnyDesk\system.conf"
"C:\ProgramData\AnyDesk\service.conf"
and it would work. Now that is not the case anymore. Even with all the scripts provided here, none of them worked.
Each time Anydesk tries to connect to the network it fails and I get "Disconnected from the network".
Anyone else having this issue as well?