mirror of
https://github.com/andsyrovatko/s4k-admin-toolbox.git
synced 2026-04-21 21:58:54 +02:00
feat: improve AnyDesk reset logic
- Added Administrator privileges check - Added 32-bit && 64-bit registry path support - Implemented flag logic for clean status output
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# 🛠 Anydesk ID reset utility
|
||||
|
||||
A lightweight Batch utility to hard-reset AnyDesk configuration and identity. Useful for resolving ID-related issues or clearing workstation footprints on Windows 10/11 \
|
||||
(including LTSC).
|
||||
|
||||
---
|
||||
|
||||
### 🚀 Key Features
|
||||
* **Hard Reset:** Cleans both User (`%AppData%`) and System (`%ProgramData%`) configurations.
|
||||
* **Registry Cleanup:** Automatically detects and removes AnyDesk keys from HKLM (`32-bit` & `64-bit` paths).
|
||||
* **Process Management:** Safely terminates AnyDesk processes before cleanup.
|
||||
* **Privilege Check:** Built-in verification for Administrator rights.
|
||||
* **Zero Dependencies:** Pure Windows Batch. No external tools required.
|
||||
* **Portable:** Can be run directly from a USB flash drive. No installation required.
|
||||
|
||||
### 🛠 Usage
|
||||
1. Right-click `anydesk-id-reseter.bat`.
|
||||
2. Select Run as Administrator.
|
||||
3. Follow the on-screen status.
|
||||
4. Launch AnyDesk to generate a new ID.
|
||||
|
||||
### 🔍 Technical Details
|
||||
The script targets the following components:
|
||||
* **Files:** `service.conf`, `system.conf` (User & System-wide).
|
||||
* **Registry:**\
|
||||
`HKLM\SOFTWARE\WOW6432Node\AnyDesk`\
|
||||
`HKLM\SOFTWARE\AnyDesk`
|
||||
|
||||
---
|
||||
|
||||
### ⚖️ License
|
||||
MIT [LICENSE](https://github.com/andsyrovatko/s4k-admin-toolbox/blob/main/LICENSE). Free to use and modify.
|
||||
@@ -1,17 +1,77 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
:: =============================================================================
|
||||
:: Script Name : anydesk-id-reseter.bat
|
||||
:: Description : AnyDesk ID Reset Utility for Windows.
|
||||
:: Usage : Run as Administrator. No arguments required.
|
||||
:: Author : syr4ok (Andrii Syrovatko)
|
||||
:: Version : 1.2.1
|
||||
:: =============================================================================
|
||||
|
||||
echo [1/2] Closing AnyDesk...
|
||||
taskkill /F /IM "AnyDesk.exe" /T 2>nul
|
||||
|
||||
echo [2/2] Removing AnyDesk cfg files (service.conf AND system.conf)...
|
||||
del /F /Q "%appdata%\AnyDesk\service.conf" 2>nul
|
||||
del /F /Q "%appdata%\AnyDesk\system.conf" 2>nul
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Script done it's work successfully!
|
||||
echo Now you can start AnyDesk again.
|
||||
echo AnyDesk Config Reset Utility
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
:: Check for Administrator privileges
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% neq 0 (
|
||||
echo [WARNING] Please run this script as Administrator.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo [+] [1/3] Terminating AnyDesk processes...
|
||||
taskkill /F /IM "AnyDesk.exe" /T 2>nul
|
||||
echo.
|
||||
|
||||
echo [+] [2/3] Cleaning configuration files...
|
||||
if exist "%appdata%\AnyDesk\service.conf" (
|
||||
del /F /Q "%appdata%\AnyDesk\service.conf"
|
||||
echo - %appdata%\AnyDesk\service.conf deleted.
|
||||
)
|
||||
if exist "%appdata%\AnyDesk\system.conf" (
|
||||
del /F /Q "%appdata%\AnyDesk\system.conf"
|
||||
echo - %appdata%\AnyDesk\system.conf deleted.
|
||||
)
|
||||
if exist "%ProgramData%\AnyDesk\service.conf" (
|
||||
del /F /Q "%ProgramData%\AnyDesk\service.conf"
|
||||
echo - %ProgramData%\AnyDesk\service.conf deleted.
|
||||
)
|
||||
if exist "%ProgramData%\AnyDesk\system.conf" (
|
||||
del /F /Q "%ProgramData%\AnyDesk\system.conf"
|
||||
echo - %ProgramData%\AnyDesk\system.conf deleted.
|
||||
)
|
||||
echo.
|
||||
|
||||
|
||||
echo [+] [3/3] Checking Registry entries...
|
||||
set "regFound=0"
|
||||
|
||||
:: 32-bit system check
|
||||
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\AnyDesk" >nul 2>&1
|
||||
if !errorLevel! equ 0 (
|
||||
echo - Found 32-bit registry key. Deleting...
|
||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\AnyDesk" /f >nul 2>&1
|
||||
set "regFound=1"
|
||||
)
|
||||
|
||||
:: 64-bit system check
|
||||
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\AnyDesk" >nul 2>&1
|
||||
if !errorLevel! equ 0 (
|
||||
echo - Found 64-bit registry key. Deleting...
|
||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\AnyDesk" /f >nul 2>&1
|
||||
set "regFound=1"
|
||||
)
|
||||
|
||||
:: Final status based on the flag
|
||||
if !regFound! equ 1 (
|
||||
echo [OK] Registry cleanup finished.
|
||||
) else (
|
||||
echo - [INFO] No relevant registry keys found. Skipping.
|
||||
)
|
||||
echo.
|
||||
|
||||
echo Success! AnyDesk is ready for a fresh start.
|
||||
echo ========================================
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user