C# start a scheduled task
问题 I'm trying to write a simple form in c# that will run a scheduled task one some computers. Whet I have so far is: private void button_Click(object sender, EventArgs e) { try { for (int i = 0; i < num_of_computers; i++) { string line; line = (" /run /tn myTask /s " + _ReplacerObj.MyComputers[i] + " /u user s /p password"); proc.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized; proc.FileName = @"C:\WINDOWS\SYSTEM32\schtasks.exe"; proc.Arguments = line; Process.Start(proc); } }