467,083 Members | 1,259 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,083 developers. It's quick & easy.

Process.WaitForExit and Windows 98 Problem

I am using the following code sucessfully on Windows 2000 and Windows XP.
However, in WIndows 98 it seems to hang on the WaitForExit. What are my
options here?

MsgBox("Please be patient. This operation could take a minute or two
to complete.", MsgBoxStyle.Information, "CPViewer")

Me.Cursor = Cursors.WaitCursor

Dim p As New System.Diagnostics.ProcessStartInfo

p.CreateNoWindow = True

p.WindowStyle = ProcessWindowStyle.Hidden

p.FileName = strInput

p.UseShellExecute = True

'Dim pr As System.Diagnostics.Process =
System.Diagnostics.Process.Start(p)

Dim pr As Process = Process.Start(p)

'Start = Microsoft.VisualBasic.DateAndTime.Timer

'Finish = Start + 120.0

'Do While Microsoft.VisualBasic.DateAndTime.Timer < Finish

'Loop

pr.WaitForExit()

pr.Close()

pr.Dispose()

Me.Cursor = Cursors.Default
Thank you,
John
Nov 21 '05 #1
  • viewed: 1382
Share:
1 Reply
John,

I do not know this problem, however when you get no better answer maybe than
you can try to catch the standardoutput at the end as a work around (I do
not know if this works better before you misunderstand me. When you try it
and it does, tell it than to us?)

\\\
Dim p As New Process
dim pi as new processstartinfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = myargumentstring
pi.WorkingDirectory = myworkdirectorystring
pi..FileName =C:\myprogram
pi.startinfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW(input))
input = sr.Read
Loop
///

I hope this helps?

Cor

"John Crouse" <no**@none.com> ..
I am using the following code sucessfully on Windows 2000 and Windows XP.
However, in WIndows 98 it seems to hang on the WaitForExit. What are my
options here?

MsgBox("Please be patient. This operation could take a minute or
two to complete.", MsgBoxStyle.Information, "CPViewer")

Me.Cursor = Cursors.WaitCursor

Dim p As New System.Diagnostics.ProcessStartInfo

p.CreateNoWindow = True

p.WindowStyle = ProcessWindowStyle.Hidden

p.FileName = strInput

p.UseShellExecute = True

'Dim pr As System.Diagnostics.Process =
System.Diagnostics.Process.Start(p)

Dim pr As Process = Process.Start(p)

'Start = Microsoft.VisualBasic.DateAndTime.Timer

'Finish = Start + 120.0

'Do While Microsoft.VisualBasic.DateAndTime.Timer < Finish

'Loop

pr.WaitForExit()

pr.Close()

pr.Dispose()

Me.Cursor = Cursors.Default
Thank you,
John

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Christian Billig | last post: by
5 posts views Thread by andrew | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.