launch batch file
-
how do i execute a .bat file and have the program halt until it finishes. what i'm doing is creating an external software installer so i can just check which programs i want to install and it installs it. once the user presses 'Install' i want it to create a temp .bat file and then execute the .bat file and wait for all the installs to finish before coming back to the main program. i would also like the .bat file to execute silently so you don't see the command prompt. thanks, Rob Tomson -- There are 10 kinds of people. Those who understand binary and those who don't.
-
how do i execute a .bat file and have the program halt until it finishes. what i'm doing is creating an external software installer so i can just check which programs i want to install and it installs it. once the user presses 'Install' i want it to create a temp .bat file and then execute the .bat file and wait for all the installs to finish before coming back to the main program. i would also like the .bat file to execute silently so you don't see the command prompt. thanks, Rob Tomson -- There are 10 kinds of people. Those who understand binary and those who don't.
Look at the Process class... You can call WaitForExit to make your app wait, for the process you start, to exit, and in the startinfo you can set that it should show no window... - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application[^]
My Photos[^] New developersite: RealDevs.Net -
Look at the Process class... You can call WaitForExit to make your app wait, for the process you start, to exit, and in the startinfo you can set that it should show no window... - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application[^]
My Photos[^] New developersite: RealDevs.NetAnders Molin wrote: and in the startinfo you can set that it should show no window... To note, this only works in Windows NT-based OSes (Windows NT 4.0, 2000, XP, and 2003 currently; Windows stopped with Me). A console window will appear for console apps regardless of
ProcessStartInfo.CreateNoWindow
. It's just the nature of Windows existing on top of DOS while Windows NT simply contains a command prompt (big difference).Microsoft MVP, Visual C# My Articles