🖥️ Batch (CMD)
Export Computer System Product Info to CSV (Batch)
Uses wmic to export Computer System Product Info (Win32_ComputerSystemProduct) to a timestamped CSV file.
ExportComputerSystemProductToCsv.bat
@echo off
:: ============================================================
:: ExportComputerSystemProductToCsv.bat
::
:: Exports Computer System Product Info (Win32_ComputerSystemProduct) to a timestamped CSV file next to
:: this script.
:: ============================================================
setlocal EnableDelayedExpansion
for /f "skip=1 tokens=1-2 delims=." %%a in ('wmic os get localdatetime') do if not defined LDT set LDT=%%a
set "OUTFILE=%~dp0computersystemproduct_!LDT:~0,8!-!LDT:~8,6!.csv"
wmic path Win32_ComputerSystemProduct get Name,Vendor,Version,IdentifyingNumber /format:csv > "%OUTFILE%"
echo Exported to "%OUTFILE%"
endlocal
pause