-->

  • PC Health Check Script in Batch Scripting

     

     

    PC Health Check Script in Batch Scripting





    PC Health Check Script in Batch Scripting | Monitor Your Windows System


    Monitoring your computer's health is an important task for every IT Support Engineer and System Administrator. Instead of checking system details manually, you can automate the process using a simple Batch Script.

    In this tutorial, we'll create a PC Health Check Script that displays useful system information such as the computer name, current user, operating system details, CPU information, and installed memory.


    Batch Script


      @echo off
    
    echo ===== PC HEALTH REPORT =====
    
    echo
    
    hostname
    
    echo
    
    whoami
    
    echo
    
    systeminfo
    
    echo
    
    wmic cpu get name
    
    echo.
    
    wmic memorychip get capacity
    
    pause
    
      


    How the Script Works


    Step 1: Display the Report Title

    echo ===== PC HEALTH REPORT =====

    This displays a heading so the output is easy to identify.



    Step 2: Display the Computer Name

    • hostname



    This command shows the name of the computer.

    Example Output

    DESKTOP-ABCD123




    Step 3: Display the Current Logged-in User

    • whoami


    This command displays the currently logged-in user.

    Example Output


    desktop-abcd123\atul




    Step 4: Display System Information
    • systeminfo


    This command provides detailed information about the system, including:

    • * Windows Version
    • * OS Build
    • * System Manufacturer
    • * BIOS Version
    • * Total Physical Memory
    • * System Boot Time
    • * Installed Hotfixes




    Step 5: Display CPU Information

    wmic cpu get name

    This command displays the processor model.

    Example Output

    Intel(R) Core(TM) i5-1135G7 CPU



    Step 6: Display Installed RAM

    wmic memorychip get capacity
    This command shows the capacity of each installed RAM module in bytes.



    Example Output

    • 8589934592
    • 8589934592

    This indicates two 8 GB memory modules.


    Step 7: Pause the Script

    pause
    The Command Prompt window remains open so you can review the report.



    Sample Output


    ===== PC HEALTH REPORT =====
    • Computer Name
    • Current User
    • Windows Information
    • CPU Information
    • Memory Information
    • Press any key to continue...




    Why Use a PC Health Check Script?


    A health check script helps you:

    * View important system information quickly
    * Save troubleshooting time
    * Verify hardware details
    * Collect information before maintenance
    * Reduce manual effort



    Real-World Uses


    System Engineers and IT Support Engineers commonly use health check scripts to:

    • * Verify computer specifications
    • * Collect diagnostic information
    • * Troubleshoot user issues
    • * Prepare systems before upgrades
    • * Generate system reports during maintenance




    Commands Used


    PC Health Check Script in Batch Scripting


    Interview Questions


    What does the hostname command do?

    • It displays the computer name.


    What information does systeminfo provide?

    • It displays operating system, hardware, memory, BIOS, and other system details.


    What is the purpose of whoami?

    • It shows the currently logged-in user.


    Which command displays CPU information?

    • wmic cpu get name



    Why is a PC Health Check Script useful?

    • It automates system diagnostics and quickly gathers important information for troubleshooting.




    Note

    The wmic command is deprecated on newer versions of Windows and may not be available on future releases. On modern Windows systems, PowerShell is the recommended tool for retrieving hardware information. However, wmic is still commonly found on many Windows 10 and Windows 11 installations, making it useful for learning Batch Scripting.



    Conclusion


    A PC Health Check Script is a practical Batch Scripting project that combines several built-in Windows commands into a single diagnostic tool. It helps IT professionals quickly collect system information and simplifies troubleshooting.

    If you're preparing for a career in IT Support, System Administration, or System Engineering, this project is a great addition to your Batch Scripting portfolio and demonstrates your ability to automate routine system checks.
     

  • 0 comments:

    Post a Comment

    For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.