System maintenance


Tasmania Green

Well-known member
Member
Local time
6:36 PM
Posts
556
OS
Windows 11 Pro - version 24H2
I'd like to see how other people approach system maintenance and repair.

I've created a list of apps and commands to run for general PC maintenance and correcting drive problems. Below are some commands and apps I've put on that list, but I'd like to get your advice on other things I should think about including.

Of course, I've created a Windows System Recovery Disk. (Someone recently gave me a short list of commands, but I can't find that now.)
I also back-up my system.

Routine Maintenance:
Disk Cleanup (regular files and system files)

Correcting Drive Problems:
SFC - System File Check
DISM /Online /Cleanup-Image /RestoreHealth
CHKDSK c: /f - Check Disk
I have the Sysinternals Suite. But there are so many apps there that I don't know which are useful.
 

My Computer

System One

  • OS
    Windows 11 Pro - version 24H2
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 7600X 6 Core AM5 5.3GHz CPU
    Motherboard
    2024 MSI MAG B650 GAMING PLUS WIFI
    Memory
    Silicon Power XPOWER Zenith 32GB (16GBx2) CL30,1.35V UDIMM 6000MHz DDR5 RAM
    Graphics Card(s)
    MSI GeForce RTX 4060 Ventus 2X Black 8G OC Graphics Card
    Monitor(s) Displays
    Asus ROG Strix XG32WCS - 32in HDR VA 180Hz USB Type-C FreeSync Curved Gaming Monitor
    Screen Resolution
    2560 x 1440
    Hard Drives
    1) Silicon Power 1TB P34A60 Gen3x4 TLC R/W up to 2,200/1,600 MB/s PCIe M.2 NVMe SSD

    2) Crucial 1TB E100 CT1000E100SSD8 Gen4 M.2 NVMe SSD
    PSU
    MSI 750W MAG A750GL 80+ Gold PCIe 5 ATX 3.0 Modular Power Supply
    Case
    SilverStone Fara R1 Pro V2 Tempered Glass ATX Case - Black
    Cooling
    Thermalright Peerless Assassin 120 SE ARGB Dual Loop CPU Cooler, 120mm Fan
    Antivirus
    Microsoft Defender
Routine Maintenance:
Disk Cleanup (regular files and system files)

You may find some suggestions in this thread?


Correcting Drive Problems:
SFC - System File Check
DISM /Online /Cleanup-Image /RestoreHealth
CHKDSK c: /f - Check Disk

You could try the batch file I have been working on, or the batch file in the first post.


I believe I need to work on “Option 9 Full” as I think it stops running the entire list due to not finding an error in analyse. But the individual options, 1 - 8 are fine. I say think because I had to stop analising it last month due to work constraints. It’s not something that will cause problems, just something (Option 9) that isn’t completing fully.
There is no ChkDsk in the menu as I don’t actually trust it.
 
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard thingy
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • Operating System
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
i don't have a recovery partition i extend C: drive but i do have backups of all data
my 1TB SSD is partitioned C: and D: drive. Windows on C: and all data on D:

all backups are done the Monday before patch Tuesday
my system checks and service are always done after patch Tuesday

sfc and DISM, disk clean up and then trim.
best of luck Steve ..
 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP 24" AiO
    CPU
    Ryzen 7 5825u
    Motherboard
    HP
    Memory
    64GB DDR4 3200
    Graphics Card(s)
    Ryzen 7 5825u
    Sound Card
    RealTek
    Monitor(s) Displays
    24" HP AiO
    Screen Resolution
    1920 x 1080 @60 Hz
    Hard Drives
    1TB WD Blue SN580 M2 SSD Partitioned.
    2x 1TB USB HDD External Backup/Storage.
    PSU
    90W external power brick
    Case
    24" All in One
    Cooling
    Default Air Cooling
    Keyboard
    HP WiFi UK extended
    Mouse
    HP WiFi 3 Button
    Internet Speed
    1GB full fibre
    Browser
    Edge & Firefox
    Antivirus
    AVG Internet Security/Windows Defender
    Other Info
    Mainly Open Source Software
  • Operating System
    Ubuntu 22.04.5 LTS
    Computer type
    Laptop
    Manufacturer/Model
    Dell 13" Latitude 2017
    CPU
    i5 7200u
    Motherboard
    Dell
    Memory
    16GB DDR4
    Graphics card(s)
    Intel
    Sound Card
    Intel
    Monitor(s) Displays
    13" Dell Laptop
    Hard Drives
    250GB Crucial 2.5" SSD
    Mouse
    Generic WiFi 3 button
    Internet Speed
    WiFi only
    Browser
    Firefox
    Antivirus
    ClamAV TK
    Other Info
    Mainly Open Source Software
I don't really maintain my system at all. I let Windows handle itself. Works the best this way. I only look into things if there are issues, and fix those. There doesn't really exist any tool that Windows doesn't already have built in. Or there do exist but those tend to break the system more than fix it.

My previous main laptop has been running for 14 yeas without maintenance, kindof. I upgraded to an SSD. That's it and it's still running smooth. Went from 7, to 8 to 8.1 and 10.

My current one has been running for 6 yeas straight, until I decided to dual boot. That's when I found it easier to just wipe everything and rebuild the partition table to my liking.
 

My Computers

System One System Two

  • OS
    Win 11 Pro 25H2 26200.8457 / Linux Mint 22.3
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo A485
    CPU
    Ryzen 7 2700U Pro
    Motherboard
    Lenovo (WiFi/BT module upgraded to Intel Wireless-AC-9260)
    Memory
    32GB
    Graphics Card(s)
    iGPU Vega 10
    Sound Card
    Realtek
    Monitor(s) Displays
    14" FHD (built-in) + 14" Lenovo Thinkvision M14t (touch+pen) + 32" Asus PB328
    Screen Resolution
    FHD + FHD + 1440p
    Hard Drives
    Intel 660p m.2 nVME PCIe3.0 x2 512GB
    PSU
    125W(Dock)/65W(Travel Adapter)
    Keyboard
    Thinkpad / Logitech MX Keys
    Mouse
    Logitech MX Master 2S
    Internet Speed
    1/1Gbit
    Browser
    Firefox
    Antivirus
    Windows Defender
    Other Info
    SecureBoot: Enabled
    TPM2.0: Enabled
    AMD-V: Enabled
  • Operating System
    Win 11 Pro 25H2 26200.8521(RP)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom
    CPU
    i7-7700k @4.8GHz
    Motherboard
    Asus PRIME Z270-A
    Memory
    32GB 2x16GB 2133MHz CL15
    Graphics card(s)
    EVGA GTX1080Ti FTW 11GB
    Sound Card
    Integrated
    Monitor(s) Displays
    32" 10-bit Asus PB328Q
    Screen Resolution
    WQHD 2560x1440
    Hard Drives
    512GB ADATA SX8000NP NVMe PCIe Gen 3 x4
    PSU
    850W
    Case
    Fractal Design Define 7
    Cooling
    Noctua NH-D15 chromax.black
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 2S
    Internet Speed
    1/1Gbit
    Browser
    Firefox
    Antivirus
    Windows Defender
    Other Info
    AC WiFi Card
I don't really maintain my system at all. I let Windows handle itself. Works the best this way. I only look into things if there are issues, and fix those.
That’s the spirit.
 

My Computer

System One

  • OS
    Win 7,8.1,10,11, Mint, Kde Plasma, Debian
    Computer type
    Laptop
    Manufacturer/Model
    Dell
    CPU
    Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    Memory
    16 GB
    Graphics Card(s)
    Intel(R) HD Graphics 520/Nvidia GeForce 930M
    Sound Card
    Intel(R) Display Audio/RealtekAudio
    Monitor(s) Displays
    Generic Pnp Monitor
    Screen Resolution
    1366 X 768
    Hard Drives
    ST2000LM024-1EJ164
    Keyboard
    Eng (US)
    Mouse
    Sanwa Supply
    Browser
    Firefox
    Antivirus
    Avast One
    Other Info
    Too many laptops with different system specifications.
Unless you have a tiny drive there isn't much of a need to do maintenance in my opinion (for personal devices)
 

My Computer

System One

  • OS
    Linux Mint
    Computer type
    Laptop
    Manufacturer/Model
    System76 Lemur Pro
I have two NVME drives (System/OS and Games/Files) and a SATA HD (general files) on my current system.

I use several programs for maintenance: Disk Cleanup and Disk Defrag (standard Windows utilties), DiskMax for when I need to do a deep clean/remove temp files, and of course DISM (primarly through Tuneup_Plus and Post_WU_Cleanup batch files both from these forums) for after Windows Updates as well as system file checks.
 

My Computer

System One

  • OS
    Windows 11 Pro 25H2 (26200.8457)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Pre-built
    CPU
    AMD Ryzen 7 7800X3D
    Motherboard
    MSI Pro B650-VC WiFi
    Memory
    32gb Team Group (T-Force) DDR5-6000
    Graphics Card(s)
    Zotac nVidia GeForce RTX 4070 SUPER - 12gb
    Sound Card
    Sound BlasterX G6
    Monitor(s) Displays
    Koorui G2421V and ViewSonic VX2453
    Screen Resolution
    P:2560x1440 S:1920x1080
    Hard Drives
    WD Blue SN5000 - 500gb NVME
    WD Blue SN580 - 2TB NVME
    Seagate 4TB HDD - ST4000VN008-2DR166
    Keyboard
    Mountain Everest
    Mouse
    Logitech G502 Hero
    Internet Speed
    T-Mobile Home Internet
    Browser
    Firefox
    Other Info
    QNAP TS-469 Pro NAS
    TP-Link W7200 (2 unit mesh network)
    Elgato Streamdeck
I also don't really do any maintenance. Things just work and I do backups. I have plenty of space on my drive.
 

My Computers

System One System Two

  • OS
    Windows 11 Home 25H2
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion 14-ce3606sa
    CPU
    Core i5-1035G1
    Memory
    32gb
    Hard Drives
    Samsung 870 evo sata ssd
    Cooling
    Could be better
    Internet Speed
    50 mbps Starlink
    Browser
    Firefox
    Other Info
    Originally came installed with a 500gb H10 Optane ssd
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion ce3606sa
    CPU
    Intel Core i5-1035G1
    Memory
    16gb
    Hard Drives
    Hynix Gold P31 2TB
    Internet Speed
    200mbps Starlink
    Browser
    Firefox
    Antivirus
    Defender
SFC - System File Check
DISM /Online /Cleanup-Image /RestoreHealth
Those are checking Windows not the disk.
Personally, I only consider Dism if there's a problem SFC cannot fix.


Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 25H2 Build 26200.8037
I do very occasionally do sfc/scannow but mainly only after an initial install.
 

My Computers

System One System Two

  • OS
    Windows 11 Home 25H2
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion 14-ce3606sa
    CPU
    Core i5-1035G1
    Memory
    32gb
    Hard Drives
    Samsung 870 evo sata ssd
    Cooling
    Could be better
    Internet Speed
    50 mbps Starlink
    Browser
    Firefox
    Other Info
    Originally came installed with a 500gb H10 Optane ssd
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion ce3606sa
    CPU
    Intel Core i5-1035G1
    Memory
    16gb
    Hard Drives
    Hynix Gold P31 2TB
    Internet Speed
    200mbps Starlink
    Browser
    Firefox
    Antivirus
    Defender
You may find some suggestions in this thread?




You could try the batch file I have been working on, or the batch file in the first post.


I believe I need to work on “Option 9 Full” as I think it stops running the entire list due to not finding an error in analyse. But the individual options, 1 - 8 are fine. I say think because I had to stop analising it last month due to work constraints. It’s not something that will cause problems, just something (Option 9) that isn’t completing fully.
There is no ChkDsk in the menu as I don’t actually trust it.
Why don't you trust Chkdsk?
 

My Computer

System One

  • OS
    Windows 11 Pro - version 24H2
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 7600X 6 Core AM5 5.3GHz CPU
    Motherboard
    2024 MSI MAG B650 GAMING PLUS WIFI
    Memory
    Silicon Power XPOWER Zenith 32GB (16GBx2) CL30,1.35V UDIMM 6000MHz DDR5 RAM
    Graphics Card(s)
    MSI GeForce RTX 4060 Ventus 2X Black 8G OC Graphics Card
    Monitor(s) Displays
    Asus ROG Strix XG32WCS - 32in HDR VA 180Hz USB Type-C FreeSync Curved Gaming Monitor
    Screen Resolution
    2560 x 1440
    Hard Drives
    1) Silicon Power 1TB P34A60 Gen3x4 TLC R/W up to 2,200/1,600 MB/s PCIe M.2 NVMe SSD

    2) Crucial 1TB E100 CT1000E100SSD8 Gen4 M.2 NVMe SSD
    PSU
    MSI 750W MAG A750GL 80+ Gold PCIe 5 ATX 3.0 Modular Power Supply
    Case
    SilverStone Fara R1 Pro V2 Tempered Glass ATX Case - Black
    Cooling
    Thermalright Peerless Assassin 120 SE ARGB Dual Loop CPU Cooler, 120mm Fan
    Antivirus
    Microsoft Defender
Why don't you trust Chkdsk?

I've read many times by members in here that it can cause issues. I can't recall exactly, but it may only be related to chkdsk /r or chkdsk /f
When I have more time I'll try to find comments on it.

May be worth as thread in here:
Is using chkdsk OK?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard thingy
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • Operating System
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
i don't have a recovery partition i extend C: drive but i do have backups of all data
my 1TB SSD is partitioned C: and D: drive. Windows on C: and all data on D:

all backups are done the Monday before patch Tuesday
my system checks and service are always done after patch Tuesday

sfc and DISM, disk clean up and then trim.
best of luck Steve ..

I have just moved my backups to run on Mondays as well. Forgot about patch Tuesdays. Thanks for the reminder.
 

My Computer

System One

  • OS
    Windows 11 Pro - version 24H2
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 7600X 6 Core AM5 5.3GHz CPU
    Motherboard
    2024 MSI MAG B650 GAMING PLUS WIFI
    Memory
    Silicon Power XPOWER Zenith 32GB (16GBx2) CL30,1.35V UDIMM 6000MHz DDR5 RAM
    Graphics Card(s)
    MSI GeForce RTX 4060 Ventus 2X Black 8G OC Graphics Card
    Monitor(s) Displays
    Asus ROG Strix XG32WCS - 32in HDR VA 180Hz USB Type-C FreeSync Curved Gaming Monitor
    Screen Resolution
    2560 x 1440
    Hard Drives
    1) Silicon Power 1TB P34A60 Gen3x4 TLC R/W up to 2,200/1,600 MB/s PCIe M.2 NVMe SSD

    2) Crucial 1TB E100 CT1000E100SSD8 Gen4 M.2 NVMe SSD
    PSU
    MSI 750W MAG A750GL 80+ Gold PCIe 5 ATX 3.0 Modular Power Supply
    Case
    SilverStone Fara R1 Pro V2 Tempered Glass ATX Case - Black
    Cooling
    Thermalright Peerless Assassin 120 SE ARGB Dual Loop CPU Cooler, 120mm Fan
    Antivirus
    Microsoft Defender

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard thingy
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • Operating System
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
Have fixed the maintenance batch script. Have a play if you like, Mike

  • When double clicking on the batch file, the script now restarts and runs as Administrator
    • Alternatively: Right click on the batch file and "Run as Administrator
  • Fixed option 9. Run All: Everything runs and completes in order
    • (PnPClean + CheckHealth + RestoreHealth + Analyze + Clean + SFC)
  • Added message to warn that restorehealth may take a while and appear to freeze at various stages and after 100.0%

Win-1937.webp


1. PnPClean only
This command removes outdated or unnecessary device drivers from your system. It cleans up orphaned drivers (drivers that are no longer in use or associated with any hardware), helping to free up space and potentially improving system performance.​

2. CheckHealth only
The `CheckHealth` option scans your system for corruption or issues in the Windows image. It doesn’t fix anything but will tell you whether the system has any integrity violations or corruption that could potentially affect Windows' functionality.​

3. RestoreHealth only
The `RestoreHealth` option uses the Windows Update system or local repair sources to automatically fix any corruption or integrity issues found in the Windows image. It can replace corrupted system files with healthy versions, repairing system issues.​
Due to the fact restorehealth /online can sometimes look like it has frozen at 100.0%, I have added a message that shows prior to restorehealth running: "Restorehealth may appear to pause at various stages and at 100.0%. Please be patient, it's working and can sometimes take a long time.."​

4. RestoreHealth + SFC
This combines the `RestoreHealth` command with `SFC` (System File Checker). First, `RestoreHealth` attempts to repair any corruption in the system image, and then `SFC` scans and repairs any specific corrupted system files that might remain.​

5. Analyze Component Store only
This option checks the state of the Component Store, which is the folder where Windows stores files related to updates, system components, and Windows features. It analyzes whether there’s any unnecessary data or issues, like excess update files, which can sometimes slow down your system or take up unnecessary space.​

6. Clean Component Store only
This command removes unnecessary or outdated files from the Component Store. This can help reduce the size of the Windows installation and free up disk space. It doesn’t fix corruption but instead cleans up old update files, repair logs, and other unused components.​

7. Analyze + Clean Component Store
This combines both `Analyze Component Store` and `Clean Component Store`. It first checks for issues or unnecessary files in the Component Store and then proceeds to clean up old and unused files, reducing clutter and saving space.​

8. SFC only
The `SFC` (System File Checker) command scans and repairs individual corrupted or missing system files in Windows. It checks protected system files and replaces them with correct versions from a local cache or from the Windows installation files.​

9.Run All
Runs all of the above.​

10. Exit
Closes the command window​
antspants_post_update_batch-1.8 batch file content:

Batch:
@echo off
title Windows 11 System Maintenance

:: --- Self-elevate to Administrator ---
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo Requesting administrative privileges...
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

:MENU
cls
color 0A
echo ==============================
echo   Windows 11 Maintenance Menu
echo        Version 1.8
echo ==============================
echo   %date%  %time%
echo ==============================
echo ----------------------------------------------
echo Please select an option from the list below by
echo typing its number and pressing Enter.
echo ----------------------------------------------
echo.
echo 1. PnPClean only
echo 2. CheckHealth only
echo 3. RestoreHealth only
echo 4. RestoreHealth + SFC
echo 5. Analyze Component Store only
echo 6. Clean Component Store only
echo 7. Analyze + Clean Component Store
echo 8. SFC only
echo 9. Run All (PnPClean + CheckHealth + RestoreHealth + Analyze + Clean + SFC)
echo 10. Exit
echo.
set /p choice="Select an option (1-10): "
color 07

:: --- Input validation ---
if "%choice%"=="" goto INVALID
for /f "delims=0123456789" %%A in ("%choice%") do goto INVALID
if %choice% lss 1 goto INVALID
if %choice% gtr 10 goto INVALID

:: --- Menu routing ---
if "%choice%"=="1" goto PNPONLY
if "%choice%"=="2" goto CHECK
if "%choice%"=="3" goto RESTORE
if "%choice%"=="4" goto RESTORESFC
if "%choice%"=="5" goto ANALYZESTORE
if "%choice%"=="6" goto CLEANSTORE
if "%choice%"=="7" goto ANALYZECLEAN
if "%choice%"=="8" goto SFCONLY
if "%choice%"=="9" goto RUNALL
if "%choice%"=="10" exit

:INVALID
echo Invalid choice, please select 1–10.
pause
goto MENU

:PNPONLY
call :PNPCLEAN
pause
goto MENU

:CHECK
call :CHECKHEALTH
pause
goto MENU

:RESTORE
call :RESTOREHEALTH
pause
goto MENU

:RESTORESFC
call :RESTOREHEALTH
call :SFC
echo [INFO] RestoreHealth + SFC finished.
pause
goto MENU

:ANALYZESTORE
call :DO_ANALYZESTORE
pause
goto MENU

:CLEANSTORE
call :DO_CLEANSTORE
pause
goto MENU

:ANALYZECLEAN
call :DO_ANALYZESTORE
call :DO_CLEANSTORE
echo [INFO] Analyze + Clean Component Store finished.
pause
goto MENU

:SFCONLY
call :SFC
pause
goto MENU

:RUNALL
call :PNPCLEAN
call :CHECKHEALTH
call :RESTOREHEALTH
call :DO_ANALYZESTORE
call :DO_CLEANSTORE
call :SFC
echo [INFO] Run All sequence finished.
pause
goto MENU

:PNPCLEAN
echo Running PnPClean...
rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
if errorlevel 1 (
    echo [ERROR] PnPClean failed.
) else (
    echo [INFO] PnPClean finished.
)
goto :EOF

:CHECKHEALTH
echo Running CheckHealth...
set "tempfile=%TEMP%\checkhealth.txt"
dism /Online /Cleanup-Image /CheckHealth > "%tempfile%" 2>&1
if errorlevel 1 (
    echo [ERROR] CheckHealth failed.
) else (
    findstr /C:"No component store corruption detected" "%tempfile%" >nul
    if not errorlevel 1 (
        echo [INFO] No corruption detected.
    ) else (
        echo [INFO] Corruption detected.
    )
)
del "%tempfile%" >nul 2>&1
goto :EOF

:RESTOREHEALTH
echo Running RestoreHealth...
echo RestoreHealth may appear to pause at various stages and at 100.0%%. Please be patient, it's working and can sometimes take a long time...
dism /Online /Cleanup-Image /RestoreHealth
if errorlevel 1 (
    echo [ERROR] RestoreHealth failed.
) else (
    echo [INFO] DISM RestoreHealth finished.
)
goto :EOF

:DO_ANALYZESTORE
echo Running AnalyzeComponentStore...
dism /Online /Cleanup-Image /AnalyzeComponentStore
if errorlevel 1 (
    echo [ERROR] AnalyzeComponentStore failed.
) else (
    echo [INFO] AnalyzeComponentStore finished.
)
goto :EOF

:DO_CLEANSTORE
echo Running StartComponentCleanup...
dism /Online /Cleanup-Image /StartComponentCleanup
if errorlevel 1 (
    echo [ERROR] StartComponentCleanup failed.
) else (
    echo [INFO] Component Store cleanup finished.
)
goto :EOF

:SFC
echo Running SFC scan...
sfc /scannow
if errorlevel 1 (
    echo [ERROR] SFC scan encountered issues.
) else (
    echo [INFO] SFC finished.
)
goto :EOF
 

Attachments

Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard thingy
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • Operating System
    Windows 11 Pro 25H2 Build 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
Back
Top Bottom