title: How to send a Yes parameter to overwrite a schedule from command line in vb.net
body: <p>I'm developing and application and I'm creating scheduled tasks from command line using vb.net.</p>
  
  <p>When I'm trying to create an existing schedule the command line window come asking if we want to overwrite the existing schedule tasks, My question is:</p>
  
  <p>How Can I send automatically that parameter if I ask it using a message box, if the user answer yes, it will replace automatically the schedule task.</p>
  
  <p>This is how I'm doing that:</p>
  
  <pre><code>Dim KeyToSend as string = " /Create /SC MONTHLY /D 11 /TN "SFTP_FILE_Javier" /TR "\"C:\Users\salasfri\Documents\Visual Studio 2012\Projects\prjFileTrans20151102\prjFileTrans\prjFileTrans\bin\Debug\prjFileTrans.exe\" SFTP_FILE" /ST 16:44"
  taskProcess.StartInfo = New ProcessStartInfo(Environment.SystemDirectory + "\SchTasks.exe", KeyToSend)
  taskProcess.Start()      
  </code></pre>
  
  <p>When the line come to the line taskProcess.Start() the command prompt windows appear asking if we want to replace the schedule task and we have to input Y/N depending if we want to do it.</p>
  
  <p>I want to do that automatically            </p>
  
  <p>I tried with using taskProcess.StartInfo.Arguments = "Y" but it didn't work</p>
  
  <p>any idea?          </p>
  
  <p>Thanks</p>