PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
invoke a function synchronously
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
invoke a function synchronously
![]() |
invoke a function synchronously |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I have a procedure that executes an external vbscript file using ShellExecute as listed below. Immediately after that, I will read whatever in a text file which is the output of that vbscript file. The problem is that the vbscript file is executed asynchronously, and I always end up opening an empty text file because the vbscript file is still running. How can I wait until the vbscript is done? Thanks a lot. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ..... |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Take a look intothe Process.Start method.
mProcess = New Process With mProcess.StartInfo .FileName = ("file.exe") .Arguments = commandLineArgs .UseShellExecute = False .CreateNoWindow = True End With mProcess.Start() mProcess.WaitForExit() <leochen76@hotmail.com> wrote in message news:1182829003.151644.144580@k79g2000hse.googlegroups.com... > Hi, > > I have a procedure that executes an external vbscript file using > ShellExecute as listed below. > Immediately after that, I will read whatever in a text file which > is the output of that vbscript file. > > The problem is that the vbscript file is executed asynchronously, > and I always end up opening an empty text file because the vbscript > file is still running. How can I wait until the vbscript is done? > Thanks a lot. > > Private Declare Function ShellExecute Lib "shell32.dll" Alias > "ShellExecuteA" ..... > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I'm sorry, but I mean how to do that in vb6. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
This is the VB.NET newsgroup. microsoft.public.vb.* would be what you are
after. <leochen76@hotmail.com> wrote in message news:1182901099.674847.264990@n60g2000hse.googlegroups.com... > > I'm sorry, but I mean how to do that in vb6. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

