Re: How to show PF usage using VBscript?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Serge (serge639_at_hotmail.com)
Date: 11/18/04


Date: Thu, 18 Nov 2004 02:27:02 -0800

MikeVa,

Really a great script. This is what I was looking for.
I will change it not to refresh but to report it to a file and then it is
very usefull for me.

Thanks for your help.

Cheers.
Serge.

"MikeVa [MSFT]" wrote:

> Use the WMI Performance Counter Classes:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/performance_counter_classes.asp?frame=true
>
> Specifically for Memory Counters:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_perfformatteddata_perfos_memory.asp?frame=true
>
> You can find samples here:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__performance_monitoring.asp?frame=true
> http://www.microsoft.com/technet/scriptcenter/default.mspx
>
> The following example would output the 'CommitedBytes' and 'PagePerSec'
> counters every 5 seconds.
>
> '---BEGIN EXAMPLE---
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" _
> & strComputer & "\root\cimv2")
> set objRefresher = CreateObject _
> ("WbemScripting.SWbemRefresher")
> Set colItems = objRefresher.AddEnum _
> (objWMIService, "Win32_PerfFormattedData_PerfOS_Memory").objectSet
> objRefresher.Refresh
> While(true)
> For Each objItem in colItems
> Wscript.Echo "Committed Bytes: " & _
> objItem.CommittedBytes
> Wscript.Echo "Pages per Second: " & _
> objItem.PagesPerSec
> Wscript.Echo "------------------------------"
> Wscript.Sleep 5000
> objRefresher.Refresh
> Next
> Wend
> '---END EXAMPLE---
>
> --
> MikeVa [MSFT]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> --
> Please do not send e-mail directly to this alias.
> This alias is for newsgroup purposes only.
> --
> "Serge" <serge639@hotmail.com> wrote in message
> news:B3530E07-4AEA-4570-B858-2275873C7191@microsoft.com...
> >I have to report the memory in use on a server. Normally I go to the
> >Windows
> > task manager and look at the PF Usage.
> > I rather use a VBscript to show it.
> >
> > Can anyone tell me what script shows me the PF usage shown in the Windows
> > task manager?
> >
> > Serge van Lith
>
>
>



Relevant Pages

  • Re: Removing Rows for Printing
    ... One is to clear a sheet of all input cells leaving ... .PrintOut ' for testing use .PrintPreview ... I attached the script to the Print Button. ... I hid the Report worksheet. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Removing Rows for Printing
    ... I attached the script to the Print Button. ... I hid the Report worksheet. ... Change PrintPreview to Printout in the code if it is working OK ... Also each cell in Col A26 through 58 has a border, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Removing Rows for Printing
    ... I hid the Report worksheet. ... Change PrintPreview to Printout in the code if it is working OK ... I can tell you that I do know how to create a button and attach the script to it. ... Also each cell in Col A26 through 58 has a border, but I would not think that has any concern. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Linux dpkg Software Report
    ... ambitious script to date, and have completed the Linux dpkg Software ... Report script which takes output from dpkg, ... does not have write priveleges in that folder. ... install script, does not depend on knowing what folder it's started from ...
    (Ubuntu)
  • RE: How to Monitor CPU usage in MSH
    ... The script retrieves the process name, main window title, processor usage, disk activity, and working set. ... One advantage it offers over Task Manager is the disk activity column. ...
    (microsoft.public.windows.server.scripting)