Just like the subject states. I want to be able to run iisreset, batch files, etc. from the a console application. Can I/How do I do it?
Thanks,
Kyle
Just like the subject states. I want to be able to run iisreset, batch files, etc. from the a console application. Can I/How do I do it?
Thanks,
Kyle
That's quite possible, for example:
System.Diagnostics.Process.Start(@"C:\listfiles.bat");
Hi, Check this example from C# Station
using System;
using System.Diagnostics;
namespace csharp_station.howto
{
/// <summary>
/// Demonstrates how to start another program from C#
/// </summary>
class ProcessStart
{
static void Main(string[] args)
{
Process notePad = new Process();
notePad.StartInfo.FileName = "notepad.exe";
notePad.StartInfo.Arguments = "ProcessStart.cs";
notePad.Start();
}
}
}
You can also do this:
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
info.UseShellExecute = true;
info.FileName = "iisreset";
System.Diagnostics.Process.Start(info);
Console.ReadLine();