Windows Vista Forums

Can parent shell monitor run/crash status of Child shell/exe ?

  1. #1


    sanjeev kumar Guest

    Can parent shell monitor run/crash status of Child shell/exe ?

    I am running automated daily-regression tests - various configs.
    I have written powershell script invoking EXEs .
    But, if any Exe crashes/stops(anything abnormal suspension) , how can my
    script track this event?

    Can a parent powershell monitor child-shell which then invokes each binary
    exec. ?

    Any suggestion would be welcome.
    Thanks.


      My System SpecsSystem Spec

  2. #2


    Marco Shaw [MVP] Guest

    Re: Can parent shell monitor run/crash status of Child shell/exe ?

    Can you provide an example? Your main PowerShell script runs these EXEs
    asynchronously, or waits until each completes?

    Marco

    "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
    news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx

    > I am running automated daily-regression tests - various configs.
    > I have written powershell script invoking EXEs .
    > But, if any Exe crashes/stops(anything abnormal suspension) , how can my
    > script track this event?
    >
    > Can a parent powershell monitor child-shell which then invokes each binary
    > exec. ?
    >
    > Any suggestion would be welcome.
    > Thanks.

      My System SpecsSystem Spec

  3. #3


    sanjeev kumar Guest

    Re: Can parent shell monitor run/crash status of Child shell/exe ?

    Hello marco,

    I am trying to achieve automation of daily regression tests, followed by
    email-send of the test status.
    My powershell script would run the Exe's synchronously, waiting untill each
    completes & go onto next.

    part of spowershell cript:

    .../bin/release/myprog.exe <config-1>
    .../bin/release/myprog.exe <config-2>
    ...
    .../bin/debug/myprog.exe <config-1
    .../bin/debug/myprog.exe <config-n>
    ...
    <mailsend> <test-status>


    Currently, If all the Exe's run to completion, my scripts sends status email
    of tests.
    But if any of Exe has abnormal termination-problem, popping up
    Windows-dialog("want to debug/close?").
    (The problem could be some memory-leaks,asserts etc. in the Exe)
    So often, my script is stuck & sends no status.

    How best to tackle this problem?
    -Sanjeev kumar

    "Marco Shaw [MVP]" <marco.shaw@xxxxxx_SPAMgmail.com> wrote in message
    news:Ok2Pb3nMKHA.5192@xxxxxx

    > Can you provide an example? Your main PowerShell script runs these EXEs
    > asynchronously, or waits until each completes?
    >
    > Marco
    >
    > "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
    > news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx

    >> I am running automated daily-regression tests - various configs.
    >> I have written powershell script invoking EXEs .
    >> But, if any Exe crashes/stops(anything abnormal suspension) , how can my
    >> script track this event?
    >>
    >> Can a parent powershell monitor child-shell which then invokes each
    >> binary exec. ?
    >>
    >> Any suggestion would be welcome.
    >> Thanks.
    >

      My System SpecsSystem Spec

  4. #4


    Marco Shaw [MVP] Guest

    Re: Can parent shell monitor run/crash status of Child shell/exe ?

    Well, I can think of 2 approaches.

    1. $LASTEXITCODE provides you the exit code of the last run console-based
    application (or .EXE).
    2. Have your main script write to a log, then possibly have a second script
    monitor this log. If all of you jobs should finish within 1 minute, for
    example, have your second script make sure that the log has been updated
    within the last 1 or 2 minutes or send out an alert email, etc.

    How's that sound?

    Marco

    "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
    news:E1D1DC9D-CAA7-49E0-A538-F1C47CFA76F6@xxxxxx

    > Hello marco,
    >
    > I am trying to achieve automation of daily regression tests, followed by
    > email-send of the test status.
    > My powershell script would run the Exe's synchronously, waiting untill
    > each completes & go onto next.
    >
    > part of spowershell cript:
    >
    > ../bin/release/myprog.exe <config-1>
    > ../bin/release/myprog.exe <config-2>
    > ..
    > ../bin/debug/myprog.exe <config-1
    > ../bin/debug/myprog.exe <config-n>
    > ..
    > <mailsend> <test-status>
    >
    >
    > Currently, If all the Exe's run to completion, my scripts sends status
    > email of tests.
    > But if any of Exe has abnormal termination-problem, popping up
    > Windows-dialog("want to debug/close?").
    > (The problem could be some memory-leaks,asserts etc. in the Exe)
    > So often, my script is stuck & sends no status.
    >
    > How best to tackle this problem?
    > -Sanjeev kumar
    >
    > "Marco Shaw [MVP]" <marco.shaw@xxxxxx_SPAMgmail.com> wrote in message
    > news:Ok2Pb3nMKHA.5192@xxxxxx

    >> Can you provide an example? Your main PowerShell script runs these EXEs
    >> asynchronously, or waits until each completes?
    >>
    >> Marco
    >>
    >> "sanjeev kumar" <sanjeev.kumar@xxxxxx> wrote in message
    >> news:077ACCDA-85CE-4DDF-8C08-8D6343ACC69C@xxxxxx

    >>> I am running automated daily-regression tests - various configs.
    >>> I have written powershell script invoking EXEs .
    >>> But, if any Exe crashes/stops(anything abnormal suspension) , how can my
    >>> script track this event?
    >>>
    >>> Can a parent powershell monitor child-shell which then invokes each
    >>> binary exec. ?
    >>>
    >>> Any suggestion would be welcome.
    >>> Thanks.
    >>
    >

      My System SpecsSystem Spec

Can parent shell monitor run/crash status of Child shell/exe ?

Similar Threads
Thread Forum
cmd.exe shell
Can't find a cmd.exe group so I'm hoping to get some help with advanced batch file features: setlocal enableextensions setlocal...
PowerShell
allow write to child folder, deny write to parent
is it possible to deny access to create files on the root of a drive and still allow modify access to subfolders?
Server General
get child node of selected parent node
All, I've tried working on this this before with no luck. I've looked all over and can't seem to find a sample that I can redo (understand) to...
.NET General
Executing Power Shell Scripts from Windows Shell
Typing powershell "D:\PowerShell Examples\TempScript.ps1" on the cmd prompt, gives an error that, The term 'D:\PowerShell' is not recognized as a...
PowerShell
Possible bug in shell?
Hi everyone, I'm developing a context menu shell extension. It is working properly in all previous versions of Windows. But Windows Vista (RTM)...
Vista General
power shell in x64
Can I (and should I) load Power Shell in XP Pro X64 or should I load it into X32? thanks John
PowerShell
Shell extension - how do I disable the preview pane for my shell e
I have a shell extension we've used for years on Win2k, XP, 2k3 server. Porting this to Vista, testing using build 5270, using .net 2005 VS C++. ...
Aero