Вы можете запустить его как часть службы, но для этого потребуется, чтобы он имел код самостоятельной установки или был установлен вручную.
Другой способ - написать приложение Windows Forms, но без формы и сделатьследующее:
using System.Windows.Forms;
using System.Diagnostics;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
string ApplicationPath = @"c:\consoleapplication.exe";
// Create a new process object
Process ProcessObj = new Process();
// StartInfo contains the startup information of
// the new process
ProcessObj.StartInfo.FileName = ApplicationPath;
// These two optional flags ensure that no DOS window
// appears
ProcessObj.StartInfo.UseShellExecute = false;
ProcessObj.StartInfo.CreateNoWindow = true;
// If this option is set the DOS window appears again :-/
// ProcessObj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
// This ensures that you get the output from the DOS application
ProcessObj.StartInfo.RedirectStandardOutput = true;
// Start the process
ProcessObj.Start();
// Wait that the process exits
ProcessObj.WaitForExit();
}
}
}
Затем вы можете вызвать это приложение с помощью своего скрипта.