Paypal Donate


( ! ) Warning: Parameter 1 to Savant2_Plugin_ahreflisting::plugin() expected to be a reference, value given in /home/ceditbiz/public_html/components/com_mtree/Savant2.php on line 1127
Call Stack
#TimeMemoryFunctionLocation
10.0136623752{main}( )../index.php:0
21.11792412848JSite->dispatch( )../index.php:68
31.12972491552JComponentHelper->renderComponent( )../application.php:124
41.18382629208require_once( '/home/ceditbiz/public_html/components/com_mtree/mtree.php' )../helper.php:162
51.32852740360viewlink( )../mtree.php:84
61.42963346552JCacheCallback->call( )../mtree.php:1850
71.42963347696JCacheCallback->get( )../callback.php:48
81.43623391152call_user_func_array:{/home/ceditbiz/public_html/libraries/joomla/cache/handler/callback.php:99} ( )../callback.php:99
91.43623391960viewlink_cache( )../callback.php:99
101.50103488792Savant2->display( )../mtree.php:1952
111.50103488792Savant2->fetch( )../Savant2.php:987
121.50593530944include( '/home/ceditbiz/public_html/components/com_mtree/templates/m2/page_listing.tpl.php' )../Savant2.php:958
131.52483534144include( '/home/ceditbiz/public_html/components/com_mtree/templates/m2/sub_listingDetails.tpl.php' )../page_listing.tpl.php:14
141.52503541200Savant2->plugin( )../sub_listingDetails.tpl.php:30
151.52503543048call_user_func_array:{/home/ceditbiz/public_html/components/com_mtree/Savant2.php:1154} ( )../Savant2.php:1154
161.52503543808Savant2->splugin( )../Savant2.php:1154
171.54383553560call_user_func_array:{/home/ceditbiz/public_html/components/com_mtree/Savant2.php:1127} ( )../Savant2.php:1127

File
info.vbs (3 views)

This WMI VBScript obtains and displays basic system information about the system.  Information includes hard disk free space (both in Mb and as a percentage of the total drive space), CPU load (at the time the script is run), total physical memory, and available physical memory (in Mb and percentage free).

It is a useful script to get a quick overview of a system, and will work on remote machines on a domain (or over a network if you have admin rights).

' Script written by David Barrett
' Copyright 2009
' http://www.cedit.biz/
'
This script is licensed under the Creative Commons
' Attribution 2.5 Licence
' http://creativecommons.org/licenses/by/2.5/
'

' You are free to use it for both personal and
' commercial purposes, so long as full attribution
' is given to the author (David Barrett).
'
' This notice must not be removed
'
'
strComputer = "."

str = "System Report for " & GetCurrentComputerName & " ("
str = str & Date() & " " & Time() & ")" & vbcrlf & vbcrlf
str = str & "Hard disks" & vbCrLf
str = str & GetFreeSpaceReport & vbCrLf
str = str & vbCrLf & "CPU Load: " & CPULoad
TotalMem=TotalMemory
FreeMem=FreePhysicalMemory
str = str & vbCrLf & "Total Physical Memory: " & FormatNumber(TotalMemory,1) & "Mb"
str = str & vbCrLf & "Available Physical Memory: " & FormatNumber(FreeMem,1)
str = str & "Mb (" & FormatNumber(((FreeMem/TotalMem)*100),1) & "%)"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutFile = objFSO.OpenTextFile("E:\Server_hdd_cpu_mem.txt", 8, True)
objOutFile.WriteLine str
wscript.echo str


Function GetCurrentComputerName
    Set oWsh = WScript.CreateObject("WScript.Shell")
    Set oWshSysEnv = oWsh.Environment("PROCESS")
    GetCurrentComputerName = oWshSysEnv("COMPUTERNAME")
End Function

Function GetFreeSpaceReport
    dim strReport
    Set oFs = WScript.CreateObject("Scripting.FileSystemObject")
    Set oDrives = oFs.Drives
    strReport=""
    on error resume next
    For Each oDrive In oDrives
        if oDrive.DriveType=2 then ' Fixed drive
            intFreeMB=CLng(oDrive.FreeSpace/1048576)
            intFreePercent=CInt((100 * (oDrive.FreeSpace/oDrive.TotalSize)))
            if Err.Number=0 then
                strReport = strReport & oDrive.DriveLetter & ": " & intFreeMB
                strReport = strReport & "MB free (" & intFreePercent & "%)" & vbcrlf
            else
                Err.Clear
            end if
        End if
    Next
    GetFreeSpaceReport=strReport
End Function

function CPULoad
    dim strResult
    strResult=""
    Set objCPU = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
        strComputer & "\root\cimv2").InstancesOf ("Win32_Processor")
    For Each system in objCPU
        strResult=system.LoadPercentage
    Next
    CPULoad=strResult & "%"
end function

function FreePhysicalMemory
    dim lngResult
    Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
        strComputer & "\root\cimv2")
    Set colSettings = objWMI.ExecQuery("Select * from Win32_OperatingSystem")
    For Each ObjOS in colSettings
        lngResult=ObjOS.FreePhysicalMemory
    Next
    FreePhysicalMemory=lngResult/1024
End function

function TotalMemory
    dim lngResult
    Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
        strComputer & "\root\cimv2")
    Set colSettings = objWMI.ExecQuery("Select TotalPhysicalMemory from Win32_ComputerSystem")
    For Each ObjOS in colSettings
        lngResult=ObjOS.TotalPhysicalMemory
    Next
    TotalMemory=lngResult/(1024*1024) ' memory in Mb
End function
Copyright © 2009 www.cedit.biz. All rights reserved.