|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Waiting for a process to halt before continuingfinish before starting the next process? Example /// FileCopy(strPath & "test.mdb", strPath & "live.mdb") Wait(Until FileCopy is Done) <---------------That is what I'm looking for Shell(someapp.exe) /// I want someapp.exe to start only after the file has been copied completely, not run asynchronously. I've done some reading on CreateProcess and WaitForSingleObject but they seem way more complicated(lengthy) then what I need for this problem. In my little program I'll need this command 60 - 80 times is why I'm looking for brevity. Thanks for any ideas. Chris Hello World - Check First App - Working on it As long as you don't do this multithreading there is no need to check if the
filecopy is done. This is the standard approach in a serial program. If you use instead of Shell, "process.start" than there is in that a method to wait until that is done. Cor Show quoteHide quote "Chris" <chriskn***@gmail.com> schreef in bericht news:1167293829.063297.248090@a3g2000cwd.googlegroups.com... > What would be the simplest way to make an app wait for one process to > finish before starting the next process? > > Example > /// > > FileCopy(strPath & "test.mdb", strPath & "live.mdb") > Wait(Until FileCopy is Done) <---------------That is what I'm > looking for > Shell(someapp.exe) > > /// > I want someapp.exe to start only after the file has been copied > completely, not run asynchronously. I've done some reading on > CreateProcess and WaitForSingleObject but they seem way more > complicated(lengthy) then what I need for this problem. In my little > program I'll need this command 60 - 80 times is why I'm looking for > brevity. > > Thanks for any ideas. > > Chris > Hello World - Check > First App - Working on it > Cor Ligthert [MVP] wrote:
> As long as you don't do this multithreading there is no need to check if the Thank you! I'm using it like this, and it seems to be working just> filecopy is done. > > This is the standard approach in a serial program. > > If you use instead of Shell, "process.start" than there is in that a method > to wait until that is done. > > Cor fine. /// Dim myProcess As Process = System.Diagnostics.Process.Start("c:\process1.exe") myProcess.WaitForExit() myProcess = System.Diagnostics.Process.Start("c:\process2.exe") myProcess.WaitForExit() myProcess = System.Diagnostics.Process.Start("c:\process3.exe") myProcess.WaitForExit() /// Chris I'm having a problem now. The path to my program is giving me a 'file
not found' error. If I do this- Shell("myapp.exe /dump " & strPath & "\db.mdb") it works perfectly If I do this- myProcess = System.Diagnostics.Process.Start("myapp.exe /dump " & strPath & "\db.mdb") it says file not found. All I did was replaced 'shell' with the process.start method. I think it has something to do with the switch '/dump' Any thoughts? Chris Chris,
Have a look at the differet samples we made. http://www.vb-tips.com/dbpages.aspx?ID=7ecd7359-0114-43bb-8f3a-14d6b93856e8 Be aware that the side is under construction at the moment. Cor Show quoteHide quote "Chris" <chriskn***@gmail.com> schreef in bericht news:1167334210.651820.23690@42g2000cwt.googlegroups.com... > I'm having a problem now. The path to my program is giving me a 'file > not found' error. > > If I do this- > Shell("myapp.exe /dump " & strPath & "\db.mdb") > it works perfectly > > If I do this- > myProcess = System.Diagnostics.Process.Start("myapp.exe /dump " & > strPath & "\db.mdb") > it says file not found. > > All I did was replaced 'shell' with the process.start method. > > I think it has something to do with the switch '/dump' > > Any thoughts? > > Chris > Cor Ligthert [MVP] wrote:
> Chris, Thanks Cor!> > Have a look at the differet samples we made. > > http://www.vb-tips.com/dbpages.aspx?ID=7ecd7359-0114-43bb-8f3a-14d6b93856e8 > > Be aware that the side is under construction at the moment. > > Cor > I finally realized that I needed to seperate the program from the arguments with commas. It's working well now. Chris
When to use AndAlso vs And ?
Just a Program Trying to get started with tables... Beginner help with FolderBrowserDialog How do I handle a NULL XmlElement? Get spawned process GotFocus versus PreviewKeyDown or Other VB.Net application deployment C# function be converted to VB.NET C# function be converted to VB.NET |
|||||||||||||||||||||||