Hi All
I want to ShellExecute a program repeatedly but not until the previous instance has finished, what's the best approach? So I effectively want to wait in a loop until the previous instance exits and then run it again.
Ideas?
TIA
Chris.
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
Dne 9.6.2021 v 11:33 Chris Davis napsal(a):
Hi All
I want to ShellExecute a program repeatedly but not until the previous instance has finished, what's the best approach? So I effectively want to wait in a loop until the previous instance exits and then run it again.
Ideas?
Look at command START /wait:
c:> start /?
TIA
Chris.
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
* -- https://docs.microsoft.com/en-us/previous-versions//d5fk67ky(v=vs.85) Function RunUsingWSH(lcExe, lcCommandLine) as Integer Local loWshShell
loWshShell = CreateObject("WScript.Shell") this.nProcessReturnCode = loWshShell.Run(lcExe + " " + lcCommandLine, 1, .t.) && Wait for result. Endfunc
Thanks Alan also found this which seems to work very well ...
https://www.berezniker.com/content/pages/visual-foxpro/check-if-exe-running-...
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Alan Bourke Sent: 09 June 2021 11:40 To: profoxtech@leafe.com Subject: Re: ShellExecute
* -- https://docs.microsoft.com/en-us/previous-versions//d5fk67ky(v=vs.85) Function RunUsingWSH(lcExe, lcCommandLine) as Integer Local loWshShell
loWshShell = CreateObject("WScript.Shell") this.nProcessReturnCode = loWshShell.Run(lcExe + " " + lcCommandLine, 1, .t.) && Wait for result. Endfunc
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
On Wed, 9 Jun 2021, at 10:33 AM, Chris Davis wrote:
Hi All
I want to ShellExecute a program repeatedly but not until the previous instance has finished, what's the best approach? So I effectively want to wait in a loop until the previous instance exits and then run it again.
Ideas?
TIA
Chris.
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Sounds like the Task Scheduler would suit you. It has an option to not run if there's an existing run in progress.
On 6/9/2021 5:33 AM, Chris Davis wrote:
Hi All
I want to ShellExecute a program repeatedly but not until the previous instance has finished, what's the best approach? So I effectively want to wait in a loop until the previous instance exits and then run it again.
Ideas?
TIA
Chris.
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]