- ;moo info - below are the useful or interesting wmi functions to use with the script
- alias mooi {
- if ($1 == name) { return $wmiget(Win32_ComputerSystem).Name }
- if ($1 == ostitle) { return $wmiget(Win32_OperatingSystem).Caption }
- if ($1 == ossp) { return $wmiget(Win32_OperatingSystem).CSDVersion }
- if ($1 == osver) { return $wmiget(Win32_OperatingSystem).Version }
- if ($1 == osinstall) { var %time = $ctime($iif($wmiget(Win32_OperatingSystem).InstallDate,$+($mid($ifmatch,7,2),/,$mid($ifmatch,5,2),/,$mid($ifmatch,1,4)) $+($mid($ifmatch,9,2),:,$mid($ifmatch,11,2),:,$mid($ifmatch,13,2)))) | return $asctime(%time) $brak($duration($calc($ctime - %time)) ago) }
- if ($1 == osarc) { return $wmiget(Win32_OperatingSystem).OSArchitecture }
- if ($1 == up) { return $uptime(system,3) }
- if ($1 == cpuname) { return $wmiget(Win32_Processor).Name }
- if ($1 == cpuspeed) { return $+($wmiget(Win32_Processor).CurrentClockSpeed,MHz) }
- if ($1 == cpuload) { return $iif($wmiget(Win32_Processor).LoadPercentage,$brak($+($ifmatch,% Load)),) }
- if ($1 == cputotal) { return $wmiget(Win32_ComputerSystem).NumberOfProcessors }
- if ($1 == cpuarch) { return $mooarch($wmiget(Win32_Processor).Architecture) }
- if ($1 == gfxmake) { return $wmiget(Win32_VideoController).AdapterCompatibility }
- if ($1 == gfxproc) { return $wmiget(Win32_VideoController).VideoProcessor }
- if ($1 == gfxram) { return $bytes($wmiget(Win32_VideoController).AdapterRam,3).suf }
- if ($1 == res) { return $+($wmiget(Win32_VideoController).currenthorizontalresolution,x,$wmiget(Win32_VideoController).currentverticalresolution) }
- if ($1 == resbit) { return $wmiget(Win32_VideoController).currentbitsperpixel $+ bit }
- if ($1 == resrate) { return $wmiget(Win32_VideoController).currentrefreshrate $+ Hz }
- if ($1 == rammax) { return $round($calc($wmiget(Win32_OperatingSystem).TotalVisibleMemorySize / 1024),1) }
- if ($1 == ramuse) { return $round($calc($wmiget(Win32_OperatingSystem).FreePhysicalMemory / 1024), 1) }
- if ($1 == netname) { return $wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).Name }
- if ($1 == netspeed) { return $calc($wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).CurrentBandwidth / 1000000) $+ MB/s }
- if ($1 == netin) { return $bytes($wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).BytesReceivedPersec).suf }
- if ($1 == netout) { return $bytes($wmiget(Win32_PerfRawData_Tcpip_NetworkInterface).BytesSentPersec).suf }
- if ($1 == hdd) { var %i 1 | while (%i <= $disk(0)) { if ($disk(%i).type == fixed) var %var %var $disk(%i).path $+($bytes($disk(%i).free).suf,/,$bytes($disk(%i).size).suf) | inc %i } | return %var }
- if ($1 == sound) { return $wmiget(Win32_SoundDevice).Name }
- if ($1 == mobo) { return $wmiget(Win32_BaseBoard).Manufacturer $wmiget(Win32_BaseBoard).Product }
- }