Results 1 to 2 of 2

Thread: How to run batch commands using a button

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    How to run batch commands using a button

    Please i want to make a program to run batch commands when I press a button

  2. #2
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: How to run batch commands using a button

    Use this to start a process.

    Code:
    Dim p As New System.Diagnostics.Process()
    p.StartInfo.CreateNoWindow = True
    p.StartInfo.RedirectStandardOutput = True
    p.StartInfo.FileName = "C:\..."
    p.StartInfo.Arguments = "-arguments"
    p.Start()
    If you want to run a command in a .bat file then use System.IO.File.WriteAllLines() to write your command to a .bat file then use Process.Start to start the file.

    If you want all this to happen when you click a button just put it on the Click event of the button.

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