❔ How to wait for process to complete
i want to make program opens async but instead of giving 'hard coded' delays but i don't know how to use Process to wait for it to complete opening
26 Replies
If you have an
async
method, simply await
itjust set process.start as await?
Ah, that's what you mean
yep
No,
Process.Start
is not asynchronousye i know but in all i mean that i want to start process and wait for it to complete run
completing openning i mean
Process.WaitForExit()
would be one way
Process.Exited
event would be anotherbut isnt it for when process is closing?
Well, I'd assume that the process does exit when it completes
actually no
How does that process signal completion, then?
iam making app to open as many apps as you want by one button and closing it by one button when you dont need this apps to be open
it dont
Then the answer to the question in the title is "you cannot"
so how to make that signal you said about
Do you have access to the source code of whatever that other app you want to run is?
nope :/
Then you cannot
but what about that is it the java app?
Does that Java app signal completion?
actually i have no idea
look, if the apps you start dont have anything implemented that give you a signal that they are open and fully initialized, you wont know if the are completely open
if apps close they return a exitcode with which you would know when they are closed
anything else you are out of luck if it isnt your code
okay ye i understand
but there isn't any option to check for that through Process?
And btw is there any good documentation or article about Process class etc?
you just know that there is a process running.. will it tell you if its still alive/open/whatever? no
as soon as you run process.start there will be a process but like you said, you want to know if its fully opened
hmm okay
Process Class (System.Diagnostics)
Provides access to local and remote processes and enables you to start and stop local system processes.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.