Windows Vista Forums

make the script wait for the execution of a program

  1. #1


    PedroCesar Guest

    make the script wait for the execution of a program

    How do I make the script wait for the execution of a program run
    through the start-process?

    Thanks

      My System SpecsSystem Spec

  2. #2


    Marco Shaw [MVP] Guest

    Re: make the script wait for the execution of a program

    I think you can sometimes try piping to out-null to cause PowerShell to wait
    for completion.

    Give that a try...

    "PedroCesar" <tecdom@newsgroup> wrote in message
    news:7d4f98e8-0530-425d-8c46-55c9597b939a@newsgroup

    > How do I make the script wait for the execution of a program run
    > through the start-process?
    >
    > Thanks

      My System SpecsSystem Spec

  3. #3


    PaulChavez Guest

    RE: make the script wait for the execution of a program

    Start-Process has a -wait parameter that does exactly that, at least in V2.

    "PedroCesar" wrote:

    > How do I make the script wait for the execution of a program run
    > through the start-process?
    >
    > Thanks
    > .
    >

      My System SpecsSystem Spec

  4. #4


    BJ Guest

    Re: make the script wait for the execution of a program

    On 18 Dez., 03:14, PedroCesar <tec...@newsgroup> wrote:

    > How do I make the script wait for the execution of a program run
    > through the start-process?
    >
    > Thanks
    In PS 1.0 i used this:

    ($proc = [system.Diagnostics.Process]::Start
    ("notepad.exe")).WaitForExit()

      My System SpecsSystem Spec


make the script wait for the execution of a program
Similar Threads
Thread Forum
Wait for finishing a logout script before logging out / shuttingdown Vista General
Wait for finishing a logout script before logging out / shuttingdown VB Script
After script is complete, wait 15 minutes, then run again VB Script
need to wait for command execution PowerShell
Terminate Script Execution? PowerShell