0

I have find batch file that start wifi hotspot automaticaly ,So I need to make a program in visual studio to run that batch file

Execute batch-file to start wifi hotspot as admin

Community
  • 1
  • 1
ymajbri
  • 13
  • 1

2 Answers2

0
// Start the child process.
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "YOURBATCHFILE.bat";
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected stream.
// p.WaitForExit();
// Read the output stream first and then wait.
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

Code is from MSDN.

0

Simply Write a program containing this line of code:

System.Diagnostics.Process.Start("c:\\batchfilename.bat");

Should work for your belonings.