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
Script execution problem
Hi all, I'm trying to install patches in PowerShell script. I'm using ("\root\cimv2:win32_process").create("cmd.exe /K...
PowerShell
Wait for finishing a logout script before logging out / shuttingdown
Hi, From win7pro I need to run a 3rd party file synch application (mysynch.exe) from a vbs script invoked from a domain GPO's User Logoff Script...
Vista General
Wait for finishing a logout script before logging out / shuttingdown
Hi, From win7pro I need to run a 3rd party file synch application (mysynch.exe) from a vbs script invoked from a domain GPO's User Logoff Script...
VB Script
After script is complete, wait 15 minutes, then run again
Thanks in advance, experts. I have a script that I would like to, whent he script has finished, it waits for 5 or 10 or 15 minutes, then runs it...
VB Script
Script Execution Over Network
I'm currently working on revising my company's logon script. When a user logs on, a remote batch file is executed that checks if the client...
VB Script
need to wait for command execution
Hi, I have a need to wait for completion of a statement before one. ie. invoke-expression "notepad test.txt" get-content test.txt What...
PowerShell
Terminate Script Execution?
I am trying to use ctrl+c to terminate a script but nothing happens. So far I have only been able to close the command shell in order to get a...
PowerShell