Win32::Process::Info The following lists all processes, but you can pass a list of pids to only get info on those ids.

#! perl -slw use strict; use Win32::Process::Info; my @fields = qw[ ProcessId Name ExecutablePath UserModeTime KernelModeTime MaximumWorkingSetSize MinimumWorkingSetSize ]; my $i = new Win32::Process::Info; printf "%10.10s %-22.22s %-40.40s %12.12s %14.14s %7.7s %7.7s\n", @fie +lds; printf "%10.10s %-22.22s %-40.40s %12.12s %14.14s %7.7s %7.7s\n", map{ defined() ? $_ : 'n/a' } @{ $_ }{ @fields } for $i->GetProcInfo(); __END__ P:\test>ProcInfo.pl ProcessId Name ExecutablePath + UserModeTime KernelModeTime Maximum Minimum 0 System Idle Process n/a + 0 183399.78125 n/a n/a 4 System n/a + 0 77.71875 1413120 0 572 SMSS.EXE C:\WINDOWS\System32\smss.exe + 0.015625 0.015625 1413120 204800 660 CSRSS.EXE n/a + 9.59375 49.78125 n/a n/a 684 WINLOGON.EXE C:\WINDOWS\system32\winlogon.exe + 0.640625 0.734375 1413120 204800 728 SERVICES.EXE C:\WINDOWS\system32\services.exe + 0.96875 2.625 1413120 204800 740 LSASS.EXE C:\WINDOWS\system32\lsass.exe + 1.671875 2.171875 1413120 204800 912 SVCHOST.EXE C:\WINDOWS\system32\svchost.exe + 0.21875 0.25 1413120 204800 968 SVCHOST.EXE C:\WINDOWS\System32\svchost.exe + 25.734375 21.984375 1413120 204800

Caution: The Max/MinWorkingSet (memory) sizes coming up on my machine are very suspect?

The script below used to produce good numbers on my old NT box, so it's probably something broken with my installation.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

In reply to Re: CPU usage on winxp by BrowserUk
in thread CPU usage on winxp by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.