How to make a program wait till a shell command finishes? For example:
Shell("format")
Console.WriteLine("Finished")
In this example the line “Finished” is first written and only after then the shell function starts. How to start the shell function first, and only when it has been finished write the line “Finished”?
Shellcan take a parameter specifying whether to wait for the program to complete or not: