CR=strcat(Num2char(13),Num2Char(10))
TAB=Num2Char(9)

BoxOpen("SysInfo","Sysinfo is examining your system.%cr%Please wait.")

wintype="retail"
if WinMetrics(22) then wintype="debug"

wcx=WinMetrics(-3)
math="Math"
switch wcx
   case 0   ; Win16
        wc=WinConfig()
        if !(wc&1) then mode="Real"
        if wc&16 then mode="Standard"
        if wc&32 then mode="Enhanced"
        
        if wc&64 then cpu=8086
        if wc&128 then cpu=80186
        if wc&2 then cpu=286
        if wc&4 then cpu=386
        if wc&8 then cpu=486
        mode = strcat(mode,' ',wintype,' Windows ')
        if !(wc&1024)  then math="No math"
        break
  case 1 ; Win32 Intel
       mode="Intel 32-bit %wintype% Windows "
       cpu= ItemExtract(6,WinSysInfo(),@tab)
       break
  case 2 ; Dec Alpha
       mode="DEC Alpha %wintype% Windows NT "
       cpu= ItemExtract(6,WinSysInfo(),@tab)
       break
  case 3 ; MIPS
       mode="MIPS %wintype% Windows NT "
       cpu= ItemExtract(6,WinSysInfo(),@tab)
       break
  case 4 ; PowerPC 
       mode="PowerPC %wintype% Windows NT "
       cpu= ItemExtract(6,WinSysInfo(),@tab)
       break
  case wcx
       cpu="Unknown CPU"
       mode="Unknown %wintype% Windows  "
endswitch




        Sysinfo=strcat(cpu,' ',mode,WinVersion(1),'.',WinVersion(0),CR)


mouse="No Mouse"
if WinMetrics(19) then mouse="Mouse"

Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)



sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)

ErrorMode(@OFF)
LastError()
PlayMedia("Status WaveForm Ready")
ErrorMode(@CANCEL)
if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)

math=NetInfo(0)
if math=="MULTINET" then math=strcat(math,"/",NetInfo(1))
sysinfo=strcat(sysinfo,math," Network installed.",CR) 



switch wcx
   case 0
       bug=WinResources(0)/1024   ; Compute memory avail
       math=strlen(bug)
       if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
       sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
       sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
      break
   case wcx
      bug=WinResources(11)/1024   ; Get Physical memory avail
      sysinfo=strcat(sysinfo,CR,bug," KB Physical Memory",CR)
      bug=(WinResources(14)/1024)+bug   ; Get Virtual memory + Physical avail
      sysinfo=strcat(sysinfo,bug," KB Total Memory",CR)
end switch



sysinfo=strcat(sysinfo,"Console ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
disks=DiskScan(1)
disks=strreplace(disks,@tab," ")
if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
disks=DiskScan(2)
disks=strreplace(disks,@tab," ")
if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
disks=DiskScan(4)
disks=strreplace(disks,@tab," ")
if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())


ver=Version()
Message("WinBatch %ver% SysInfo",Sysinfo)


