How can i Hide Window when running console application which running by TaskScheduler.
Below the code i have written to create task.
TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "Convert TO HL7 Message";
td.Settings.Hidden = true;
TimeTrigger tt = new TimeTrigger();
tt.StartBoundary = DateTime.Now;
tt.Repetition.Interval = TimeSpan.FromMinutes(1);
tt.Repetition.Duration = TimeSpan.FromDays(1);
td.Triggers.Add(tt);
string argument = textBox1.Text.Replace(' ', '^');
argument = argument + "$" + textBox2.Text.Replace(' ', '^');
argument = argument + "$" + textBox3.Text.Replace(' ', '^');
string exePath = System.Configuration.ConfigurationManager.AppSettings["ConvertToHL7ExePath"].ToString(); td.Actions.Add(new ExecAction(exePath, argument, null)); ts.RootFolder.RegisterTaskDefinition(@"Test", td);