Option to run vb app from command line RRS feed

  • Question

  • Hi

    I'm developing an vb.Net application that loads some data into a database. This consists of a basic form for user input and a loader class that is used to load the data.

    My problem is that I need to allow the application to be run from command line with no user input (ie as a batch process). I've set up an ini file and have used Microsoft.VisualBasic.Command to detect the command line parameter "batch" within the constructor of the form (public sub new()), which runs the loader without user input.

    That's all working fine, but when I run it from command line the application executes, but the commandline doesn't wait until the process has finished before prompting for the next command.

    This is a problem if the app is run from a batch file, as other commands following it would execute before my application finishes.

    Anyone know of a way to get the command line to wait until the vb application finishes?



    Tuesday, June 13, 2006 2:38 PM


All replies

  • This isn't really a VB problem at all, but a shell scripting problem. If you get help /? on the Start command, it should help you out. If that doesn't help, then you could 'google' shell scripting or batch file commands.
    Tuesday, June 13, 2006 3:11 PM
  • Run it like this:
      start /wait myapp.exe batch

    Tuesday, June 13, 2006 8:47 PM
  • this does not work too

    start /wait myapp.exe batch


    On win xp , it started a new command prompt window

    that window had the prompt showing. The VB exe was not run at all

    Wednesday, January 24, 2007 12:31 PM