Batch Script For Collecting System Information on Windows


FreeBooter

Well-known member
Pro User
VIP
Local time
1:55 AM
Posts
3,923
OS
Windows 11
Hello everyone,

I code this batch script to collect system information, it's useful when you need to have system information ready on your Windows 10 and Windows 11 PC.


:: Collecting System Information on Windows 10 and Windows 11

@Echo Off


(Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B)

Cls & Mode CON LINES=11 COLS=65 & Color 0E



Echo.
Echo.
Echo.
Echo.
Echo Collecting System Information
Echo.
Echo Please Wait...
Echo.

If not exist "C:\SysInfo" Md "C:\SysInfo"

Systeminfo > "C:\SysInfo\Systeminfo.txt"

GPRESULT /r /z > "C:\SysInfo\GroupPolicy.txt"

GPRESULT /f /h "C:\SysInfo\GroupPolicy.html" 2>&1>nul

If Exist %SystemRoot%\MiniDump\*.dmp Copy %SystemRoot%\MiniDump\*.dmp "C:\SysInfo" 2>&1>nul

Copy %SystemRoot%\System32\drivers\etc\hosts "C:\SysInfo\Hosts.txt" 2>&1>nul

Msinfo32 /nfo "C:\SysInfo\Msinfo32.nfo" 2>&1>nul

If Exist wevtutil.exe Wevtutil qe System /f:text > "C:\SysInfo\SystemEventlog.txt" 2>&1>nul

If Exist wevtutil.exe Wevtutil qe Application /f:text > "C:\SysInfo\ApplicationEventlog.txt" 2>&1>nul

If Exist bcdedit.exe Bcdedit /enum all > "C:\SysInfo\Bcdedit.txt" 2>&1>nul

Dxdiag /t "C:\SysInfo\dxdiag.txt"

powercfg.exe /energy /duration 10 /output "C:\SysInfo\Energy_Report.html" 2>&1>nul

PowerShell Get-CimInstance -ClassName Win32_Process ^| Out-File -FilePath "C:\SysInfo\Process.txt"

PowerShell Get-Service ^| where status -eq "Running" ^| Out-File -FilePath "C:\SysInfo\RunningServices.txt"

PowerShell Get-Service ^| where status -eq "stopped" ^| Out-File -FilePath "C:\SysInfo\StoppedServices.txt"

PowerShell Get-WindowsOptionalFeature -Online ^| ? state -eq "disabled" ^| select featurename ^| sort -Descending ^| Out-File -FilePath "C:\SysInfo\DisabledFeatures.txt"

PowerShell Get-psdrive -psprovider filesystem ^| Out-File -FilePath "C:\SysInfo\PartitionList.txt"

PowerShell Get-CimInstance win32_desktop ^| where name -eq (whoami) ^| Out-File -FilePath "C:\SysInfo\CurrentlyLogonUser.txt"

PowerShell Get-CimInstance -ClassName Win32_BIOS ^| Out-File -FilePath "C:\SysInfo\BIOS.txt"

PowerShell Get-CimInstance -ClassName Win32_Processor ^| Select-Object -ExcludeProperty "CIM*" ^| Out-File -FilePath "C:\SysInfo\CPU.txt"

PowerShell Get-CimInstance -ClassName Win32_ComputerSystem ^| Out-File -FilePath "C:\SysInfo\PCModelInformation.txt"

PowerShell Get-CimInstance -ClassName Win32_QuickFixEngineering ^| Out-File -FilePath "C:\SysInfo\Hotfixes.txt"

PowerShell Get-CimInstance -ClassName Win32_OperatingSystem ^| Select-Object -Property BuildNumber,BuildType,OSType,ServicePackMajorVersion,ServicePackMinorVersion ^| Out-File -FilePath "C:\SysInfo\OperatingSystemVersionInformation.txt"

PowerShell Get-CimInstance -ClassName Win32_OperatingSystem ^| Select-Object -Property *user* ^| Out-File -FilePath "C:\SysInfo\RegisteredUser.txt"

PowerShell Get-CimInstance -ClassName Win32_LocalTime ^| Out-File -FilePath "C:\SysInfo\LocalTime.txt"

PowerShell Get-WmiObject win32_baseboard ^| Format-List Product,Manufacturer,SerialNumber,Version,Model,Name ^| Out-File -FilePath "C:\SysInfo\MotherBoardInfo.txt"

PowerShell Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* ^| Select-Object DisplayName, DisplayVersion, Publisher, InstallDate ^| Out-File -FilePath "C:\SysInfo\InstalledPrograms.txt"

PowerShell Get-WindowsDriver -Online -All ^| Out-File -FilePath "C:\SysInfo\Drivers.txt"

wmic diskdrive get Name, Manufacturer, Model, InterfaceType, MediaType, SerialNumber > "C:\SysInfo\DiskDrive.txt"


PowerShell Get-WindowsEdition -Online ^| Out-File -FilePath "C:\SysInfo\WindowsEdition.txt"

PowerShell Get-NetAdapter -Name * -Physical ^| Out-File -FilePath "C:\SysInfo\NetworkAdapters.txt"

PowerShell Get-NetIPConfiguration -All ^| Out-File -FilePath "C:\\SysInfo\IPConfiguration.txt"

PowerShell Get-WmiObject win32_physicalmemory ^| Format-Table Manufacturer,Banklabel,Configuredclockspeed,Devicelocator,Capacity,Serialnumber -autosize ^| Out-File -FilePath "C:\SysInfo\Memory.txt"

PowerHhell Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" ^| Select-Object DisplayName, DisplayVersion, Publisher, InstallDate ^| Out-File -FilePath "C:\SysInfo\Applications.txt"

Explorer.exe "C:\SysInfo"
 

Attachments

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
I think it's better to write to an html file.
 

My Computer

System One

  • OS
    Microsoft Windows 11 Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI MS-7D98
    CPU
    Intel Core i5-13490F
    Motherboard
    MSI B760 GAMING PLUS WIFI
    Memory
    2 x 16 Patriot Memory (PDP Systems) PSD516G560081
    Graphics Card(s)
    GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (GV-N4070WF3OC-12GD)
    Sound Card
    Bluetooth Аудио
    Monitor(s) Displays
    INNOCN 15K1F
    Screen Resolution
    1920 x 1080
    Hard Drives
    WD_BLACK SN770 250GB
    KINGSTON SNV2S1000G (ELFK0S.6)
    PSU
    Thermaltake Toughpower GF3 1000W
    Case
    CG560 - DeepCool
    Cooling
    ID-COOLING SE-224-XTS / 2 x 140Mm Fan - rear and top; 3 x 120Mm - front
    Keyboard
    Corsair K70 RGB TKL
    Mouse
    Corsair KATAR PRO XT
    Internet Speed
    100 Mbps
    Browser
    Firefox
    Antivirus
    Microsoft Defender Antivirus
    Other Info
    https://www.userbenchmark.com/UserRun/66553205

Latest Support Threads

Back
Top Bottom