Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Calling a .bat file from within vb.net

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Resolved [RESOLVED] [2005] Calling a .bat file from within vb.net

    Hi Everyone,

    How do you execute a .bat file from within VB?

  2. #2
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    424

    Re: [2005] Calling a .bat file from within vb.net

    This should work
    VB.NET Code:
    1. System.Diagnostics.Process.Start("NameOfFile.bat")

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Calling a .bat file from within vb.net

    You can also use the ProcessStartInfo class when calling process.start() to tell Windows to not create any window when it runs the batch file. This way you won't see the flash of the cmd prompt window when the batch file runs.

  4. #4
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    424

    Re: [2005] Calling a .bat file from within vb.net

    Or This

    VB.NET Code:
    1. System.Diagnostics.Process.Start("cmd.exe", "NameOfFile.bat")

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: [2005] Calling a .bat file from within vb.net

    thank you for your suggestions. they really helped me out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width