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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top