PC Review


Reply
Thread Tools Rate Thread

How do I tell when a Shelled Process ends?

 
 
Mac Lingo
Guest
Posts: n/a
 
      5th Oct 2007
I've an application that starts an FTP call with the Shell Command which
sends its output to a file. The Shell command of course returns a Process
Id number. There is probably a way to use this Process Id to figure out
that process is finished, so I can collect the output and go on with the
program. But I don't know how.

One obvious way is to wait for the file that was output to be found by a Dir
command. By that process seems to hang sometimes. So I thought I'd see if
there was a way go figure out if the process was finished directly.

Anyone out there know how to do this?

Thanks,
Mac


 
Reply With Quote
 
 
 
 
Robert Bruce
Guest
Posts: n/a
 
      5th Oct 2007

"Mac Lingo" <(E-Mail Removed)> wrote in message
news:6akNi.57778$(E-Mail Removed)...
> I've an application that starts an FTP call with the Shell Command which
> sends its output to a file. The Shell command of course returns a Process
> Id number. There is probably a way to use this Process Id to figure out
> that process is finished, so I can collect the output and go on with the
> program. But I don't know how.
>
> One obvious way is to wait for the file that was output to be found by a
> Dir command. By that process seems to hang sometimes. So I thought I'd
> see if there was a way go figure out if the process was finished directly.
>
> Anyone out there know how to do this?
>


The easiest way I've found is to create a Windows shell object and execute
its Run method which has a third param that you can use to tell it only to
return to processing when the shelled operation has finished.
http://msdn2.microsoft.com/en-us/library/d5fk67ky.aspx

Sub test()
Const HIDE_WINDOW As Long = 0
Dim objShell As Object
Set objShell = CreateObject("WScript.Shell")
objShell.Run "C:\test.bat", HIDE_WINDOW, True
Set objShell = Nothing
End Sub

HTH

Rob

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How To Use a 32-Bit Applic to Determine When a Shelled Process End BillCo Microsoft Access VBA Modules 0 1st Dec 2006 04:42 PM
Kill shelled process =?Utf-8?B?QnJpYW4=?= Microsoft Access VBA Modules 0 13th Feb 2006 05:15 PM
Determine When a Shelled Process Completes =?Utf-8?B?R2FyeQ==?= Microsoft Access VBA Modules 2 2nd May 2005 10:11 PM
Shelled Process with hidden window Bill Sturdevant Microsoft Access Form Coding 1 16th Oct 2003 10:11 AM
Detect when shelled program ends No Spam Microsoft Access Forms 2 30th Sep 2003 12:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 PM.