I am trying to create a batch file that will use the systeminfo command to put things such as the OS, domain currently logged onto, manufacture, computer model, etc. into an HTML table. This is the contents of my current batch file:
@echo off
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"OS Manufacturer" /C:"OS Configuration" /C:"OS Build Type" /C:"Original Install Date" /C:"System Boot Time" /C:"System Manufacturer" /C:"System Model" /C:"System Type" /C:"Processor(s)" /C:"BIOS Version" /C:"Windows Directory" /C:"System Directory" /C:"Boot Device" /C:"System Locale" /C:"Input Locale" /C:"Total Physical Memory" /C:"Available Physical Memory" /C:"Virtual Memory: Max Size" /C:"Virtual Memory: Available" /C:"Virtual Memory: In Use" /C:"Domain" /C:"Network Card(s)"
pause
This is the current output:
OS Name: Microsoft Windows 7 Professional
OS Version: 6.1.7601 Service Pack 1 Build 7601
Original Install Date: 7/26/2011, 1:47:23 AM
System Boot Time: 2/25/2014, 1:39:14 AM
System Manufacturer: Dell Inc.
System Model: Inspiron 1501
System Type: X86-based PC
Processor(s): 1 Processor(s) Installed.
Domain: WORKGROUP
Press any key to continue . . .
How can I put this into a HTML table? Any help would be greatly appreciated! Thanks.
It all depends on how fancy you want to get. The simplest way would be
And here is a way with a CSS formatted table
The following should work for you. Happy to provide any explanation.
Obviously change the
>>test.html
to be the name of whatever file you want to output to, I suggest a variable might be best. You also might want to deletef.txt
at the end of the script. You can style it by echoing whatever CSS to (I've used)test.html
.