SHARE
    TWEET
    Najeebsk

    WIN-CLEANER.bat

    Dec 10th, 2024
    753
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    Batch 1.69 KB | None | 0 0
    1. rem This script was written by Najeeb Shah Kahn - Published in 2024
    2. rem email: [email protected]
    3. cls
    4. @echo off
    5. :: Check for admin privileges
    6. net session >nul 2>&1
    7. if %errorlevel% neq 0 (
    8. echo Requesting administrator privileges...
    9. powershell -Command "Start-Process '%~f0' -Verb RunAs"
    10. exit /b
    11. )
    12. rem Check If User Has Admin Privileges
    13. timeout /t 1 /nobreak > NUL
    14. openfiles > NUL 2>&1
    15. if %errorlevel%==0 (
    16. echo Running..
    17. ) else (
    18. echo You must run me as an Administrator. Exiting..
    19. echo.
    20. echo Right-click on me and select ^'Run as Administrator^' and try again.
    21. echo.
    22. echo Press any key to exit..
    23. pause > NUL
    24. exit
    25. )
    26. echo.
    27. rem Delete Temporary Files
    28. del /s /f /q %WinDir%\Temp\*.*
    29. del /s /f /q %WinDir%\Prefetch\*.*
    30. del /s /f /q %Temp%\*.*
    31. del /s /f /q %AppData%\Temp\*.*
    32. del /s /f /q %HomePath%\AppData\LocalLow\Temp\*.*
    33. rem Delete Used Drivers Files (Not needed because already installed)
    34. del /s /f /q %SYSTEMDRIVE%\AMD\*.*
    35. del /s /f /q %SYSTEMDRIVE%\NVIDIA\*.*
    36. del /s /f /q %SYSTEMDRIVE%\INTEL\*.*
    37. rem Delete Temporary Folders
    38. rd /s /q %WinDir%\Temp
    39. rd /s /q %WinDir%\Prefetch
    40. rd /s /q %Temp%
    41. rd /s /q %AppData%\Temp
    42. rd /s /q %HomePath%\AppData\LocalLow\Temp
    43. rem Delete Used Drivers Folders (Not needed because already installed)
    44. rd /s /q %SYSTEMDRIVE%\AMD
    45. rd /s /q %SYSTEMDRIVE%\NVIDIA
    46. rd /s /q %SYSTEMDRIVE%\INTEL
    47. rem Recreate Empty Temporary Folders
    48. md %WinDir%\Temp
    49. md %WinDir%\Prefetch
    50. md %Temp%
    51. md %AppData%\Temp
    52. md %HomePath%\AppData\LocalLow\Temp
    53. nircmd.exe emptybin
    54. echo.
    55. echo Windows Clean Up Done!, You can exit by pressing any key.
    56. echo.
    57. echo Najeeb Running as administrator!
    58. pause > NUL
    59. exit
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /