Hi all, I have the following code below which I need to modify a bit.
The script currently lists the key/value pairs for all processes in the system. What I need to achieve is for it to only list the key/value pairs for processes of which the "Description" key is of a certain ASCII value, say "analytics.exe". Can someone shed some light on the problem please? #!/usr/bin/perl use Win32::Process::Info; # get API calls #my @info_flds = ('CSCreationClassName', 'CSName', 'Caption', 'CommandLine', #'CreationClassName', 'CreationDate', 'Description', 'ExecutablePath', #'ExecutionState', 'Handle', 'HandleCount', 'InstallDate', 'KernelModeTime', #'MaximumWorkingSetSize', 'MinimumWorkingSetSize', 'Name', #'OSCreationClassName', 'OSName', 'OtherOperationCount', 'OtherTransferCount', #'Owner', 'OwnerSid', 'PageFaults', 'PageFileUsage', 'ParentProcessId', #'PeakPageFileUsage', 'PeakVirtualSize', 'PeakWorkingSetSize', 'Priority', #'PrivatePageCount', 'ProcessId', 'QuotaNonPagedPoolUsage', #'QuotaPagedPoolUsage', 'QuotaPeakNonPagedPoolUsage', #'QuotaPeakPagedPoolUsage', 'ReadOperationCount', 'ReadTransferCount', #'SessionId', 'Status', 'TerminationDate', 'ThreadCount', 'UserModeTime', #'VirtualSize', 'WindowsVersion', 'WorkingSetSize', 'WriteOperationCount', #'WriteTransferCount', #); # get process info my $pi = Win32::Process::Info->new (); my @info = $pi->GetProcInfo(); foreach my $info (@info) { foreach $_ ('ProcessId', 'Description', 'ThreadCount') { print "$_ = ", $info->{$_} || '', "\n"; } print "\n"; } Kind Regards, Wim Olivier __________________________________________________________________________________________________________________________________ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries ("the Group"). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___________________________________________________________________________________________________________________________________ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>