@echo off
echo ========================================
echo   VMware Tools Cleanup Tool
echo ========================================
echo.

net session >nul 2>&1
if %errorLevel% neq 0 (
    echo [Error] Please right-click this file and choose "Run as administrator"
    pause
    exit
)

echo [1/4] Stopping and deleting VMware services...
sc stop "VMware Tools" >nul 2>&1
sc delete "VMware Tools" >nul 2>&1
sc stop vmtools >nul 2>&1
sc delete vmtools >nul 2>&1

echo [2/4] Cleaning registry...
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc." /f >nul 2>&1
reg delete "HKEY_CURRENT_USER\Software\VMware, Inc." /f >nul 2>&1

echo [3/4] Cleaning completed.
echo.
echo Next steps you need to do manually:
echo 1. Delete folder: C:\Program Files\VMware\VMware Tools
echo 2. Restart the virtual machine
echo 3. In VMware menu: VM -> Install VMware Tools
echo.
echo After restart and reinstall, check if VMware Tools appears in Services.
echo.
pause