可以得到当前系统信息的脚本sysinfo.vbs

2019-01-16 12:09:55王旭

with obj4
wnl vbcrlf&"Memory Info :"
wnl "  Total Physical Memory : "&cint(.totalphysicalmemory/1024)&"MB"
wnl "  Free Physical Memory : "&cint(obj2.freephysicalmemory/1024)&"MB"
if viewtype=1 then
wnl "  Total PageFile Space : "&cint(.totalpagefilespace/1024)&"MB"
wnl "  Total Virtual Memory : "&cint(.totalvirtualmemory/1024)&"MB"
wnl "  Available Virtual Memory : "&cint(.availablevirtualmemory/1024)&"MB"
end if
end with

if viewtype=1 then
wnl vbcrlf&"BIOS Info :"
wnl "  Description : "&obj5.description
wnl "  Current Language : "&obj5.currentlanguage
wnl "  Version : "&obj5.version
wnl "  Manufacturer : "&obj5.manufacturer
end if

with obj6
wnl vbcrlf&"Display Configuration :"
wnl "  Caption : "&.caption
if viewtype=1 then
wnl "  Device Name : "&.devicename
wnl "  Driver Version : "&.driverversion
end if
wnl "  Display Frequency : "&.displayfrequency&"Hz"
wnl "  Bits Per Pel : "&.bitsperpel&"Bit"
wnl "  Pels : "&.pelswidth&" x "&.pelsheight
end with

wnl vbcrlf&"Disk Info :"
for each obj7 in col7
with obj7
wnl "  DeviceID : "&.deviceid
wnl "  Caption : "&.caption
wnl "  Interface Type : "&.interfacetype
if viewtype=1 then
wnl "  SCSI Bus : "&.scsibus
wnl "  SCSI Logical Unit : "&.scsilogicalunit
wnl "  SCSI Port : "&.scsiport
wnl "  SCSI TargetId : "&.scsitargetid
wnl "  Sectors Per Track : "&.sectorspertrack&"KB"
end if
wnl "  Partitions : "&.partitions
wnl "  Size : "&sizeformat(.size)
end with
next
str="  Volume"+space(2)+"Type"+space(8)+"Format"+space(4)
str=str+"Size"+space(6)+"Free"+space(12)+"Label"
wnl str
for each obj8 in col8
with obj8
drivetype=""
select case .drivetype
case 0
   drivetype="Unknow"
case 1
   drivetype="NoRootDir"
case 2
   drivetype="Removable"
case 3
   drivetype="Fixed"
case 4
   drivetype="Network"
case 5
   drivetype="CD-ROM"
case 6
   drivetype="RAM"
end select
strpercent=""
if .size<>"" and .freespace<>"" then
strpercent=" ("&formatpercent(.freespace/.size,0)&")"
end if
str="  "&wsp(.caption,8)&wsp(drivetype,12)&wsp(.filesystem,10)&wsp(sizeformat(.size),10)
str=str&wsp(sizeformat(.freespace)&strpercent,16)&.volumename
wnl str
end with
next