processes, quick command line listing? - Programmer

This is a discussion on processes, quick command line listing? - Programmer ; Is there a way to get a listing of processes that show-up in the windows task manager? Something along the lines of.... cmd_list_processes | sort > afile thanks....

+ Reply to Thread
Results 1 to 5 of 5

Thread: processes, quick command line listing?

  1. processes, quick command line listing?

    Is there a way to get a listing of processes that show-up in the
    windows task manager?
    Something along the lines of....

    cmd_list_processes | sort > afile

    thanks.

  2. Re: processes, quick command line listing?

    On Dec 9, 12:44 pm, 2apart wrote:
    > Is there a way to get a listing of processes that show-up in the
    > windows task manager?
    > Something along the lines of....
    >
    > cmd_list_processes | sort > afile
    >
    > thanks.



    Hi,

    You can use the following APIs to take a snapshot of the running
    processes, modules and applications in the system's background.

    However, there maybe multiple copies of the same executable program
    are running concurrently on the target machine, moreoever, between
    the time you start walking the process list and the time you finish,
    it is possible that your process may have exited in the interim.

    CreateToolhelp32Snapshot()

    Process32First()

    Process32Next()

    CloseHandle()

    http://msdn2.microsoft.com/en-us/library/ms682489.aspx

    http://msdn2.microsoft.com/en-us/library/ms684834.aspx

    http://msdn2.microsoft.com/en-us/library/ms684836.aspx

    http://msdn2.microsoft.com/en-us/library/ms724211.aspx

    http://msdn2.microsoft.com/en-us/library/ms686701.aspx

    http://www.microsoft.com/msj/0199/nerd/nerd0199.aspx

    Kellie.


  3. Re: processes, quick command line listing?


    > Hi,
    >
    > You can use the following APIs to take a snapshot of the runningprocesses, modules and applications in the system's background.
    >
    > However, there maybe multiple copies of the same executable program
    > are running concurrently on the target machine, moreoever, between
    > the time you start walking the process list and the time you finish,
    > it is possible that your process may have exited in the interim.
    >
    > CreateToolhelp32Snapshot()
    >
    > Process32First()
    >
    > Process32Next()
    >
    > CloseHandle()
    >
    > http://msdn2.microsoft.com/en-us/library/ms682489.aspx
    >
    > http://msdn2.microsoft.com/en-us/library/ms684834.aspx
    >
    > http://msdn2.microsoft.com/en-us/library/ms684836.aspx
    >
    > http://msdn2.microsoft.com/en-us/library/ms724211.aspx
    >
    > http://msdn2.microsoft.com/en-us/library/ms686701.aspx
    >
    > http://www.microsoft.com/msj/0199/nerd/nerd0199.aspx
    >
    > Kellie.


    Thanks Kellie, but using the API like that is out of my league. I
    thought maybe there might
    be a javascript/perl script I could create using wmi. Thanks though.

  4. Re: processes, quick command line listing?

    On Dec 10, 7:30 pm, 2apart wrote:
    >
    > Thanks Kellie, but using the API like that is out of my league. I
    > thought maybe there might
    > be a javascript/perl script I could create using wmi. Thanks though.- Hide quoted text -
    >
    > - Show quoted text -



    Hi,

    The following weblink might help you out:

    http://www.microsoft.com/technet/sys...ssmonitor.mspx

    Kellie.


  5. Re: processes, quick command line listing?

    On Dec 11, 2:59 pm, Kellie Fitton wrote:
    > On Dec 10, 7:30 pm, 2apart wrote:
    >
    >
    >
    > > Thanks Kellie, but using the API like that is out of my league. I
    > > thought maybe there might
    > > be a javascript/perl script I could create using wmi. Thanks though.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Hi,
    >
    > The following weblink might help you out:
    >
    > http://www.microsoft.com/technet/sys.../processmonito...
    >
    > Kellie.


    Hi Kellie. I posted this same request over in
    public.microsoft.scripting.wmi. I'll copy the answer here
    just to complete this. Thanks again.

    This will show all the running processes from Win32_Process ...

    Option Explicit
    Dim objWMIService, objProcess, colProcess
    Dim strComputer, strList

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")

    Set colProcess = objWMIService.ExecQuery _
    ("Select * from Win32_Process")

    For Each objProcess in colProcess
    strList = strList & VbCrLf & _
    objProcess.Name
    Next

    WSCript.Echo strList
    WScript.Quit

+ Reply to Thread