Skip to content

Instantly share code, notes, and snippets.

@yatyricky
Created October 23, 2025 05:13
Show Gist options
  • Select an option

  • Save yatyricky/1b682b41a5908f8d28d0597cbc981450 to your computer and use it in GitHub Desktop.

Select an option

Save yatyricky/1b682b41a5908f8d28d0597cbc981450 to your computer and use it in GitHub Desktop.
@echo off
REM Check if PowerShell Get-WmiObject is available
powershell -Command "Get-WmiObject Win32_ComputerSystem" >nul 2>&1
if %errorlevel% equ 0 (
hostname
powershell -Command "Get-WmiObject Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture"
powershell -Command "Get-WmiObject Win32_BaseBoard | Select-Object Product"
powershell -Command "Get-WmiObject Win32_Processor | Select-Object Name"
powershell -Command "Get-WmiObject Win32_PhysicalMemory | Select-Object BankLabel, Capacity, MemoryType, TypeDetail, Speed"
powershell -Command "Get-WmiObject Win32_VideoController | Select-Object Name, AdapterRAM"
powershell -Command "Get-PhysicalDisk | Select-Object FriendlyName, MediaType, BusType, Size" 2>nul
) else (
hostname
wmic os get Caption,Version,BuildNumber,OSArchitecture
wmic baseboard get product
wmic cpu get name
wmic memorychip get BankLabel, Capacity, MemoryType, TypeDetail, Speed
wmic path win32_VideoController get Name,AdapterRAM
wmic diskdrive get Model,Size,MediaType,InterfaceType
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment