How do I run a batch file from within vb.net?

  • Thread starter Thread starter Guest
  • Start date Start date
System.Diagnostics.Process.Start(sBatchFile)

Not sure why it's in the "Diagnostics" namespace though - maybe one of
the geniuses at Microsoft can answer this one.
 
Hi

To make TheNedMan's answer more complete when you have parameters.
\\\
Public Class Main
Public Shared Sub Main()
Dim p As New Process
p.StartInfo.UseShellExecute = True
p.StartInfo.Arguments = "c:\windows\win.ini"
p.StartInfo.FileName = "notepad.exe"
p.Start()
End Sub
End Class
///
I hope this helps?

Cor
 
Back
Top