Please i want to make a program to run batch commands when I press a button
Printable View
Please i want to make a program to run batch commands when I press a button
Use this to start a process.
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.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 all this to happen when you click a button just put it on the Click event of the button.