Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Wait for Program to finish in Commandline?

I want my program to do a command in the commandline, then wait till that command finishes and it jumps back to CMD asking for the next command.

How would I do that?
Well in order to create a command line and execute a command in it, you can try using Process.Start.
(Jan 20, 2017 10:14 AM)Annabelle Lee Wrote:  Well in order to create a command line and execute a command in it, you can try using Process.Start.

yup what he said, if i recall the process class has this method that would block the current thread until it was exited.

Code
dim p as process = Process.Start("path\to\app.ex")
p.WaitForExit()


I might be wrong but this should be it
(Jan 20, 2017 10:22 AM)Barret Wrote:  yup what he said, if i recall the process class has this method that would block the current thread until it was exited.

Code
dim p as process = Process.Start("path\to\app.ex")
p.WaitForExit()


I might be wrong but this should be it

You should have a second argument to it, which will be the commands to run.

Code
Process.Start("path\to\app.exe", "command here")


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by bytespmApr 5, 2025 08:33 AM 10 452 Apr 5, 2025 08:33 AM
Last Post: Robert Rouge
[Shell] by friiz1337May 14, 2020 04:09 AM 2 203 May 14, 2020 04:09 AM
Last Post: sed-i
[Shell] by HackooMay 26, 2018 08:51 PM 5 258 May 26, 2018 08:51 PM
Last Post: Erhan