Home All Groups Group Topic Archive Search About
Author
16 Jan 2007 1:38 PM
Brillig
Is there anequivalent of the DOS shell "start /wait", to allow a command,
especially a GUI exe, to finish before executing the next line in the
PowerShell.

--
Regards,
Brillig.

Author
16 Jan 2007 4:18 PM
Andrew Watt [MVP]
Hi,

Not that I'm aware of.

You'll get a larger body of people to potentially respond to your
PowerShell questions on microsoft.public.windows.powershell.

Andrew Watt MVP

On Tue, 16 Jan 2007 05:38:00 -0800, Brillig
<Bril***@discussions.microsoft.com> wrote:

Show quoteHide quote
>Is there anequivalent of the DOS shell "start /wait", to allow a command,
>especially a GUI exe, to finish before executing the next line in the
>PowerShell.
>
>--
>Regards,
>Brillig.
Author
16 Jan 2007 6:25 PM
JakeDAHS
get-help start-sleep




Andrew Watt [MVP] wrote:
Show quoteHide quote
> Hi,
>
> Not that I'm aware of.
>
> You'll get a larger body of people to potentially respond to your
> PowerShell questions on microsoft.public.windows.powershell.
>
> Andrew Watt MVP
>
> On Tue, 16 Jan 2007 05:38:00 -0800, Brillig
> <Bril***@discussions.microsoft.com> wrote:
>
> >Is there anequivalent of the DOS shell "start /wait", to allow a command,
> >especially a GUI exe, to finish before executing the next line in the
> >PowerShell.
> >
> >--
> >Regards,
> >Brillig.
Author
16 Jan 2007 6:48 PM
Andrew Watt [MVP]
Yes, that takes you part way. But it pauses for a specified period of
time, which is ok if the GUI app exits before the end of that period.

A better fit solution from microsoft.public.windows.powershell which
doesn't depend on guesssing a period of time for the GUI app to
complete  is as follows:

# get a handle for the Notepad process to wait for
$notepad = [System.Diagnostics.Process]::Start( "notepad.exe" )
# wait indefinitely...
$notepad.WaitForExit()

Andrew Watt MVP

Show quoteHide quote
On 16 Jan 2007 10:25:46 -0800, "JakeDAHS" <jskib***@gmail.com> wrote:

>get-help start-sleep
>
>
>
>
>Andrew Watt [MVP] wrote:
>> Hi,
>>
>> Not that I'm aware of.
>>
>> You'll get a larger body of people to potentially respond to your
>> PowerShell questions on microsoft.public.windows.powershell.
>>
>> Andrew Watt MVP
>>
>> On Tue, 16 Jan 2007 05:38:00 -0800, Brillig
>> <Bril***@discussions.microsoft.com> wrote:
>>
>> >Is there anequivalent of the DOS shell "start /wait", to allow a command,
>> >especially a GUI exe, to finish before executing the next line in the
>> >PowerShell.
>> >
>> >--
>> >Regards,
>> >Brillig.
Author
23 Jan 2007 2:27 PM
JakeDAHS
I'm not worthy :)  but I learned something new!

Thanks Andrew


Andrew Watt [MVP] wrote:
Show quoteHide quote
> Yes, that takes you part way. But it pauses for a specified period of
> time, which is ok if the GUI app exits before the end of that period.
>
> A better fit solution from microsoft.public.windows.powershell which
> doesn't depend on guesssing a period of time for the GUI app to
> complete  is as follows:
>
> # get a handle for the Notepad process to wait for
> $notepad = [System.Diagnostics.Process]::Start( "notepad.exe" )
> # wait indefinitely...
> $notepad.WaitForExit()
>
> Andrew Watt MVP
>
> On 16 Jan 2007 10:25:46 -0800, "JakeDAHS" <jskib***@gmail.com> wrote:
>
> >get-help start-sleep
> >
> >
> >
> >
> >Andrew Watt [MVP] wrote:
> >> Hi,
> >>
> >> Not that I'm aware of.
> >>
> >> You'll get a larger body of people to potentially respond to your
> >> PowerShell questions on microsoft.public.windows.powershell.
> >>
> >> Andrew Watt MVP
> >>
> >> On Tue, 16 Jan 2007 05:38:00 -0800, Brillig
> >> <Bril***@discussions.microsoft.com> wrote:
> >>
> >> >Is there anequivalent of the DOS shell "start /wait", to allow a command,
> >> >especially a GUI exe, to finish before executing the next line in the
> >> >PowerShell.
> >> >
> >> >--
> >> >Regards,
> >> >Brillig.