|
using System;
using System.Diagnostics;
namespace CallBatchFile
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Process p=null;
try
{
string targetDir;
targetDir = string.Format(@"C:\Temp\CallBatchFile\BatchFile");
p= new Process();
p.StartInfo.WorkingDirectory = targetDir;
p.StartInfo.FileName = "MyBatchFile.bat";
p.StartInfo.Arguments = string.Format("C-Sharp Console application");
p.StartInfo.CreateNoWindow = false;
p.Start();
p.WaitForExit();
}
catch (Exception ex)
{
Console.WriteLine("Exception Occurred :{0},{1}" ,ex.Message,ex.StackTrace.ToString());
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Microsoft solution Developer since 1996. Worked on different technolgies including but not limited to Visual Studio .NET , ASP .NET , C# Visual C++ , MFC , COM , DCOM ,OLE.
Expertiesed on different industry sectors of software development such as system softwares (worked for Intel and Microsoft ),application softwares (Manufacturing,Financial,Security,Airline industry, Multimedia)
Site developer for religious community in his spare time http://www.trimbakeshwar.net