void TimeElapsed(object sender, ElapsedEventArgs args) { //string exePath = "%SystemRoot%\\system32\\notepad.exe " + schedule.ScheduleID.ToString(); //string exePath = "D:\\Projects\\GAG\\WMS_30\\wms30\\RunConsole\\bin\\Debug\\RunConsole.exe "; try { string exePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SchedulerConsole.exe"); //Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) //Environment.CurrentDirectory if (!File.Exists(exePath)) { WriteEventLog("File " + exePath + " not found."); return; } AppLauncher launcher = new AppLauncher(exePath); //Manda a Ejecutar el Schedule new Thread(new ThreadStart(launcher.RunApp)).Start(); } catch (Exception ex) { WriteEventLog(GetTechMessage(ex)); } }
public AppLauncher () { if (instance == null) { instance = this; if (!Settings.toolbar_plugin_loaded) { Settings.applauncher = true; } if (Settings.applauncher) { addButton (); } } }