Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. launch batch file

launch batch file

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rob Tomson
    wrote on last edited by
    #1

    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.

    A 1 Reply Last reply
    0
    • R Rob Tomson

      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.

      A Offline
      A Offline
      Anders Molin
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • A Anders Molin

        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

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        Anders 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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups