Write the following code.
var strComputer = ".";
var SWBemlocator = new ActiveXObject("WbemScripting.SWbemLocator");
var objWMIService =
SWBemlocator.ConnectServer(strComputer, "/root/CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS");
var e = new
Enumerator(colItems);
function BiosCharacteristics() {
for (; !e.atEnd(); e.MoveNext()) {
return
GetBiosCharacteristics(e.item().BiosCharacteristics);
}
}
function BIOSVersion() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().BIOSVersion;
}
}
function BuildNumber() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().BuildNumber;
}
}
function Caption() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().Caption;
}
}
function CurrentLanguage() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().CurrentLanguage;
}
}
function Description() {
for (; !e.atEnd(); e.MoveNext()) {
return e.item().Description;
}
}
function InstallableLanguages() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().InstallableLanguages;
}
}
function InstallDate() {
for (; !e.atEnd(); e.MoveNext()) {
return
ConvertToDateTime(e.item().InstallDate);
}
}
function LanguageEdition() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().LanguageEdition;
}
}
function Manufacturer() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().Manufacturer;
}
}
function Name() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().Name;
}
}
function PrimaryBIOS() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().PrimaryBIOS;
}
}
function ReleaseDate() {
for (; !e.atEnd(); e.MoveNext()) {
return
ConvertToDateTime(e.item().ReleaseDate);
}
}
function SerialNumber() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SerialNumber;
}
}
function SMBIOSBIOSVersion() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SMBIOSBIOSVersion;
}
}
function SMBIOSMajorVersion() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SMBIOSMajorVersion;
}
}
function SMBIOSMinorVersion() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SMBIOSMinorVersion;
}
}
function SMBIOSPresent() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SMBIOSPresent;
}
}
function SoftwareElementID() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().SoftwareElementID;
}
}
function SoftwareElementState() {
for (; !e.atEnd(); e.MoveNext()) {
return
GetSoftwareElementState(e.item().SoftwareElementState);
}
}
function Status() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().Status;
}
}
function TargetOperatingSystem() {
for (; !e.atEnd(); e.MoveNext()) {
return
GetTargetOperatingSystem(e.item().TargetOperatingSystem);
}
}
function Version() {
for (; !e.atEnd(); e.MoveNext()) {
return
e.item().Version;
}
}
function GetBiosCharacteristics(charac) {
switch (charac) {
case 0:
return "Reserved";
case 1:
return "Reserved";
case 2:
return "Unknown";
case 3:
return "BIOS Characteristics
Not Supported";
case 4:
return "ISA is
supported";
case 5:
return "MCA is
supported";
case 6:
return "EISA is
supported";
case 7:
return "PCI is
supported";
case 8:
return "PC Card
(PCMCIA) is supported";
case 9:
return "Plug
and Play is supported";
case
10: return "APM
is supported";
case
11: return "BIOS
is Upgradable (Flash)";
case
12: return "BIOS
shadowing is allowed";
case
13: return "VL-VESA
is supported";
case
14: return "ESCD
support is available";
case
15: return "Boot
from CS is supported";
case
16: return "Selectable
Boot is supported";
case
17: return "BIOS
ROM is socketed";
case
18: return "Boot
From PC Card (PCMCIA) is supported";
case
19: return "EDD
(Enhanced Disk Drive) Specification is supported";
case
20: return "Int
13h - Japanese Floppy for NEC 9800 1.2mb (3.5, 1k Bytes/Sector, 360RPM) is
supported";
case
21: return "Int
13h - Japanese Floppy for Toshiba 1.2mb (3.5, 360RPM) is supported";
case
22: return "Int
13h - 5.25/360KB Floppy Services are supported";
case
23: return "Int
13h - 5.25/1.2MB Floppy Services are supported";
case
24: return "Int
13h - 3.5/720KB Floppy Services are supported";
case
25: return "Int
13h - 3.5/2.88MB Floppy Services are supported";
case
26: return "Int
5h, Print Screen Service is supported";
case
27: return "Int
9h, 8042 Keyboard Services are supported";
case
28: return "Int
14h, Serial Services are supported";
case
29: return "Int
17h, Printer Services are supported";
case
30: return "Int
10h, CGA/Mono Video Services are supported";
case 31: return "NEC PC-98";
case
32: return "ACPI
is supported";
case
33: return "USB
Legacy is supported";
case
34: return "AGP
is supported";
case
35: return "I2O
boot is supported";
case
36: return "LS-120
boot is supported";
case
37: return "ATAPI
ZIP Drive boot is supported";
case
38: return "1394
boot is supported";
case
39: return "Smart
Battery is supported";
case
40: return "Reserved
for BIOS vendor";
case
41: return "Reserved
for BIOS vendor";
case
42: return "Reserved
for BIOS vendor";
case
43: return "Reserved
for BIOS vendor";
case
44: return "Reserved
for BIOS vendor";
case
45: return "Reserved
for BIOS vendor";
case 46:
return "Reserved
for BIOS vendor";
case
47: return "Reserved
for BIOS vendor";
case
48: return "Reserved
for system vendor";
case
49: return "Reserved
for system vendor";
case
50: return "Reserved
for system vendor";
case
51: return "Reserved
for system vendor";
case
52: return "Reserved
for system vendor";
case
53: return "Reserved
for system vendor";
case
54: return "Reserved
for system vendor";
case
55: return "Reserved
for system vendor";
case
56: return "Reserved
for system vendor";
case
57: return "Reserved
for system vendor";
case
58: return "Reserved
for system vendor";
case
59: return "Reserved
for system vendor";
case
60: return "Reserved
for system vendor";
case
61: return "Reserved
for system vendor";
case
62: return "Reserved
for system vendor";
case
63: return "Reserved
for system vendor";
default:
return "Unknown";
}
}
function ConvertToDateTime(unconverted) {
var converted = "";
if (unconverted != null) {
var
year = parseInt(unconverted.substr(0, 4));
var
month = parseInt(unconverted.substr(4, 2));
var
date = parseInt(unconverted.substr(6, 2));
var
hours = parseInt(unconverted.substr(8, 2));
var
minutes = parseInt(unconverted.substr(10, 2));
var
seconds = parseInt(unconverted.substr(12, 2));
var
meridian = "AM";
if
(hours > 12) {
hours -= 12;
meridian = "PM";
}
converted = date.toString() + "/" + month.toString() + "/" + year.toString() + " " + hours.toString() + ":" + minutes.toString() + ":" + seconds.toString() + " " + meridian;
}
return converted;
}
function GetSoftwareElementState(ses) {
switch (ses) {
case 0:
return "Deployable";
case 1:
return "Installable";
case 2:
return "Executable";
case 3:
return "Running";
default:
return "Unknown";
}
}
function GetTargetOperatingSystem(tos) {
switch (tos) {
case 0:
return "Unknown";
case 1:
return "Other";
case 2:
return "MACOS";
case 3:
return "ATTUNIX";
case 4:
return "DGUX";
case 5:
return "DECNT";
case 6:
return "Digital
Unix";
case 7:
return "OpenVMS";
case 8:
return "HPUX";
case 9:
return "AIX";
case
10: return "MVS";
case
11: return "OS400";
case
12: return "OS/2";
case
13: return "JavaVM";
case
14: return "MSDOS";
case
15: return "WIN3x";
case
16: return "WIN95";
case
17: return "WIN98";
case
18: return "WINNT";
case
19: return "WINCE";
case
20: return "NCR3000";
case
21: return "NetWare";
case
22: return "OSF";
case
23: return "DC/OS";
case
24: return "Reliant
UNIX";
case
25: return "SCO
UnixWare";
case
26: return "SCO
OpenServer";
case
27: return "Sequent";
case
28: return "IRIX";
case
29: return "Solaris";
case
30: return "SunOS";
case
31: return "U6000";
case
32: return "ASERIES";
case
33: return "TandemNSK";
case
34: return "TandemNT";
case
35: return "BS2000";
case
36: return "LINUX";
case
37: return "Lynx";
case
38: return "XENIX";
case
39: return "VM/ESA";
case
40: return "Interactive
UNIX";
case
41: return "BSDUNIX";
case
42: return "FreeBSD";
case
43: return "NetBSD";
case
44: return "GNU
Hurd";
case
45: return "OS9";
case
46: return "MACH
Kernel";
case
47: return "Inferno";
case
48: return "QNX";
case
49: return "EPOC";
case
50: return "IxWorks";
case
51: return "VxWorks";
case
52: return "MiNT";
case
53: return "BeOS";
case
54: return "HP
MPE";
case
55: return "NextStep";
case
56: return "PalmPilot";
case
57: return "Rhapsody";
case
58: return "Windows
2000";
case
59: return "Dedicated";
case
60: return "VSE";
case
61: return "TPF";
default:
return "Unknown";
}
}
<!DOCTYPE html
PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BIOS</title>
<style type="text/css">
th
{
text-align:
left;
}
</style>
<script type="text/javascript" src="Script.js"></script>
<script type="text/javascript">
function
load() {
show("biosCharacteristics",
BiosCharacteristics());
show("biosVersion",
BIOSVersion());
show("buildNumber",
BuildNumber());
show("caption",
Caption());
show("currentLanguage",
CurrentLanguage());
show("description",
Description());
show("installableLanguages",
InstallableLanguages());
show("installDate",
InstallDate());
show("languageEdition",
LanguageEdition());
show("manufacturer",
Manufacturer());
show("name",
Name());
show("primaryBIOS",
PrimaryBIOS());
show("releaseDate",
ReleaseDate());
show("serialNumber",
SerialNumber());
show("smBIOSBIOSVersion",
SMBIOSBIOSVersion());
show("smBIOSMajorVersion",
SMBIOSMajorVersion());
show("smBIOSMinorVersion",
SMBIOSMinorVersion());
show("smBIOSPresent",
SMBIOSPresent());
show("softwareElementID",
SoftwareElementID());
show("softwareElementState",
SoftwareElementState());
show("status",
Status());
show("targetOperatingSystem",
TargetOperatingSystem());
show("version",
Version());
}
function
show(id, value) {
document.getElementById(id).innerHTML =
value;
}
</script>
</head>
<body
onload="load()">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<th>BiosCharacteristics:</th>
<td id="biosCharacteristics"></td>
</tr>
<tr>
<th>BIOSVersion:</th>
<td id="biosVersion"></td>
</tr>
<tr>
<th>BuildNumber:</th>
<td id="buildNumber"></td>
</tr>
<tr>
<th>Caption:</th>
<td id="caption"></td>
</tr>
<tr>
<th>CurrentLanguage:</th>
<td id="currentLanguage"></td>
</tr>
<tr>
<th>Description:</th>
<td id="description"></td>
</tr>
<tr>
<th>InstallableLanguages:</th>
<td id="installableLanguages"></td>
</tr>
<tr>
<th>InstallDate:</th>
<td id="installDate"></td>
</tr>
<tr>
<th>LanguageEdition:</th>
<td id="languageEdition"></td>
</tr>
<tr>
<th>Manufacturer:</th>
<td id="manufacturer"></td>
</tr>
<tr>
<th>Name:</th>
<td id="name"></td>
</tr>
<tr>
<th>PrimaryBIOS:</th>
<td id="primaryBIOS"></td>
</tr>
<tr>
<th>ReleaseDate:</th>
<td id="releaseDate"></td>
</tr>
<tr>
<th>SerialNumber:</th>
<td id="serialNumber"></td>
</tr>
<tr>
<th>SMBIOSBIOSVersion:</th>
<td id="smBIOSBIOSVersion"></td>
</tr>
<tr>
<th>SMBIOSMajorVersion:</th>
<td id="smBIOSMajorVersion"></td>
</tr>
<tr>
<th>SMBIOSMinorVersion:</th>
<td id="smBIOSMinorVersion"></td>
</tr>
<tr>
<th>SMBIOSPresent:</th>
<td id="smBIOSPresent"></td>
</tr>
<tr>
<th>SoftwareElementID:</th>
<td id="softwareElementID"></td>
</tr>
<tr>
<th>SoftwareElementState:</th>
<td id="softwareElementState"></td>
</tr>
<tr>
<th>Status:</th>
<td id="status"></td>
</tr>
<tr>
<th>TargetOperatingSystem:</th>
<td id="targetOperatingSystem"></td>
</tr>
<tr>
<th>Version:</th>
<td id="version"></td>
</tr>
</table>
</body>
</html>