Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Sysinfo Script
- ;Made by Adorable
- alias -l WbemOpen {
- .comopen Wbem.1 WbemScripting.SWbemLocator
- .comclose Wbem.1 $com(Wbem.1,ConnectServer,3,dispatch* Wbem.2)
- }
- alias -l WbemGet {
- if ($com(Wbem.3)) { .comclose Wbem.3 }
- if ($com(Wbem.2,ExecQuery,3,bstr*,select $2 from $1,dispatch* Wbem.3)) { var %Result $comval(Wbem.3,$3,$2) }
- .comclose Wbem.3
- return %Result
- }
- alias QuickDisk {
- var %x $disk(0), %total 0, %free 0
- while (%x) {
- if (%d != f) {
- %total = $calc(%total + $disk(%x).size)
- %free = $calc(%free + $disk(%x).free)
- }
- dec %x
- }
- return 10Disk Space: 12Total 10-04 $bytes(%total).suf 12Free 10-04 $bytes(%free).suf
- }
- alias RAM {
- if (!$com(Wbem.2)) { WbemOpen }
- return 10RAM:12 Total 10-04 $round($calc($WbemGet(Win32_OperatingSystem,TotalVisibleMemorySize,1)/1048576),2) $+ GB 12Free 10- 04 $+ $round($calc($WbemGet(Win32_OperatingSystem,FreePhysicalMemory,1)/1048576),2) $+ GB
- }
- alias gpu return 10GPU:12 $WbemGet(Win32_VideoController,AdapterCompatibility,1) 10-04 $WbemGet(Win32_VideoController,VideoProcessor,1)
- alias cpu {
- .comopen Processor WbemScripting.SWbemLocator
- if (!$comerr) {
- if ($com(Processor, ConnectServer, 3, dispatch* Specs)) {
- if ($com(Specs, Get, 3, string, Win32_Processor.DeviceID='CPU0', dispatch* Results)) {
- var %m, %n, %l
- if ($com(Results, Manufacturer, 3)) { %m = $com(Results).result }
- if ($com(Results, Name, 3)) { %n = $com(Results).result }
- if ($com(Results, LoadPercentage, 3)) { %l = $com(Results).result }
- .comclose Results
- }
- .comclose Specs
- }
- .comclose Processor
- return 10CPU:12 %m 10-04 %n 12load 10-04 %l $+ %
- }
- else { .comclose Processor | return }
- }
- alias SysInfo say $osv $QuickDisk $ram $cpu $gpu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement