@echo off
title Ultimate Tech Tool
color 8F
    0 = Black       8 = Gray
    1 = Blue        9 = Light Blue
    2 = Green       A = Light Green
    3 = Aqua        B = Light Aqua
    4 = Red         C = Light Red
    5 = Purple      D = Light Purple
    6 = Yellow      E = Light Yellow
    7 = White       F = Bright White
    
echo Welcome to the Ultimate Tech Tool!
echo.

@echo off
title Ultimate Tech Tool
color 0G
echo Welcome to the Ultimate Tech Tool!
echo.

:menu
color 8B
echo Please select an option:
echo.
echo INFORMATION
echo.
echo 1. System Information
echo 2. Disk Usage
echo 3. Network Configuration
echo 4. List Installed Programs
echo 5. View System Logs
echo 6. checkperformance
echo 7. Check for Windows Updates
echo.
echo MAINTENANCE
echo.
echo 8. Clear Temp Files 1
echo 9. Clean Temp Files 2
echo 10. Windows Image Repair (DISM)
echo 11. Run DISM
echo 12. SFC Scan
echo 13. Disk Cleanup
echo 14. Reset Network Stack
echo 15. Quick Scan with Windows Defender
echo 16. updatedrivers
echo 17. Renew IP
echo 18. Backup Important Files
echo 19. Shutdown/Restart Options
echo 20. Anydesk Reset
echo.
echo CHANGE OS VERSIONS
echo.
echo 21. Upgrade to Windows Home Single Language
echo 22. Upgrade to Windows Home
echo 23. Upgrade to Windows Pro



set /p choice=Enter your choice (1-21): 

if "%choice%"=="1" goto sysinfo
if "%choice%"=="2" goto diskusage
if "%choice%"=="3" goto netconfig
if "%choice%"=="4" goto listprograms
if "%choice%"=="5" goto viewlogs
if "%choice%"=="6" goto checkperformance
if "%choice%"=="7" goto windowsupdates
if "%choice%"=="8" goto cleartemp
if "%choice%"=="9" goto clean_temp
if "%choice%"=="10" goto imagerepair
if "%choice%"=="11" goto run_dism
if "%choice%"=="12" goto sfc
if "%choice%"=="13" goto diskcleanup
if "%choice%"=="14" goto networkreset
if "%choice%"=="15" goto quickscan
if "%choice%"=="16" goto updatedrivers
if "%choice%"=="17" goto iprenew
if "%choice%"=="18" goto backupfiles
if "%choice%"=="19" goto shutdown
if "%choice%"=="20" goto anydeskrenew
if "%choice%"=="21" goto upgradeSingleLanguage
if "%choice%"=="22" goto upgradeHome
if "%choice%"=="23" goto upgradePro


echo Invalid choice, please try again.
goto menu

:: Add the corresponding sections for each feature here...




echo Invalid choice, please try again.
goto menu

:sysinfo
color 7C
echo.
echo --- System Information ---
systeminfo
pause
goto menu

:diskusage
color 7C
echo.
echo --- Disk Usage ---
wmic logicaldisk get size,freespace,caption
pause
goto menu

:netconfig
color 7C
echo.
echo --- Network Configuration ---
ipconfig /all
pause
goto menu

:windowsupdates
color 7C
echo.
echo --- Checking for Windows Updates ---
powershell -Command "Get-WindowsUpdate"
pause
goto menu

:cleartemp
color 7C
echo.
echo --- Clearing Temp Files ---
echo Clearing user temp files...
del /q /f %temp%\*
del /q /f C:\Windows\Temp\*.* 
echo User temp files cleared.

echo Clearing SoftwareDistribution folder...
del /q /f C:\Windows\SoftwareDistribution\*.* 
echo SoftwareDistribution folder cleared.

:clean_temp
color 7C
echo Cleaning up temporary files...
del /q /s C:\Windows\SoftwareDistribution\*.*
del /q /s C:\Windows\Temp\*.*
del /q /s C:\Users\%USERNAME%\AppData\Local\Temp\*.*
echo Temporary files cleaned.
pause
goto menu

:imagerepair
color 7C
echo.
echo --- Image Reapir ---
dism /online /cleanup-image /restorehealth
pause
goto menu

:dism
color 7C
echo Running DISM...
dism /online /cleanup-image /restorehealth
echo DISM completed.
pause
goto menu

:sfc
color 7C
echo.
echo --- System Health Check ---
sfc /scannow
pause
goto menu

:diskcleanup
color 7C
echo.
echo --- Launching Disk Cleanup ---
cleanmgr
pause
goto menu

:listprograms
color 7C
echo.
echo --- Installed Programs ---
wmic product get name,version
pause
goto menu

:quickscan
color 7C
echo.
echo --- Running Quick Scan with Windows Defender ---
start /wait "" "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 1
pause
goto menu

:networkreset
color 7C
echo.
echo --- Resetting Network Stack ---
netsh int ip reset
netsh winsock reset
ipconfig /flushdns
echo Network stack reset and DNS cache flushed.
pause
goto menu

:backupfiles
color 7C
echo.
echo --- Backing Up Important User Directories to D:\Backups ---

:: Define the backup destination
set backupDest=D:\Backups

:: Create the backup destination directory if it doesn't exist
if not exist "%backupDest%" (
    mkdir "%backupDest%"
)

:: Define the folders to back up
set folders=Desktop Documents Downloads Music Pictures Videos
set additionalFolders=C:\Users\%username%\AppData\Local\Google C:\Users\%username%\AppData\Local\Microsoft\Edge

:: Loop through each folder and back it up
for %%f in (%folders%) do (
    echo Copying %%f from user directory to backup location...
    robocopy "%userprofile%\%%f" "%backupDest%\%%f" /E /COPYALL /R:3 /W:5 /XO /XN
)

:: Loop through additional folders and back them up
for %%g in (%additionalFolders%) do (
    echo Copying %%g to backup location...
    robocopy "%%g" "%backupDest%\%%~nG" /E /COPYALL /R:3 /W:5 /XO /XN
)

echo Backup completed successfully.
pause
goto menu
)

:viewlogs
color 7C
echo.
echo --- Opening Event Viewer ---
eventvwr
pause
goto menu

:shutdown
color 7C
echo.
echo --- Shutdown Options ---
echo 1. Shutdown
echo 2. Restart
echo 3. Cancel
set /p shutdown_choice=Choose an option (1-3): 
if "%shutdown_choice%"=="1" shutdown /s /t 0
if "%shutdown_choice%"=="2" shutdown /r /t 0
goto menu

:checkperformance
color 7C
echo.
echo --- Current Running Processes ---
tasklist
pause
goto menu

:updatedrivers
color 7C
echo.
echo --- Checking for Driver Updates ---
start "" "C:\Program Files\Driver Booster\DriverBooster.exe" /update
pause
goto menu

:pipscapy
color 7C
echo.
echo --- Checking for Driver Updates ---
pip install scapy
pause
goto menu

pause
goto menu

:telnet
color 7C
echo.
echo --- Checking for Driver Updates ---
pip install scapy
pause
goto menu

pause
goto menu

:iprenew
color 7C
echo.
echo --- Releasing current ip and obtaining a new IP ---
ipconfig /release
ipconfig /renew
echo
ipconfig
pause
goto menu

:anydeskrenew
@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

:changeSingleLanguage
echo Changing to Windows Home Single Language...
DISM /Online /Set-Edition:HomeSingleLanguage /AcceptEula
echo Change process initiated. Please wait...
pause
goto menu

:changeHome
echo Changing to Windows Home...
DISM /Online /Set-Edition:Home /AcceptEula
echo Change process initiated. Please wait...
pause
goto menu

:changePro
echo Changing to Windows Pro...
DISM /Online /Set-Edition:Professional /AcceptEula
echo Change process initiated. Please wait...
pause
goto menu