0

How can I select replace file automaticaly in the command prompt?

I am trying to run the following command:

schtasks /create /tn "Restart Ingenico" /tr "C:\IT_Dept\RestartShift4.bat" /sc daily /st 07:30 /y
Pause

When I do this, I get the following error message:

Invalid argument/option - "/y". Type "schtasks /create /?" for usage
GregL
  • 9,370
  • 2
  • 25
  • 36
Yuriy
  • 1
  • 1
    What do you expect with `/y` ? It is not an available switch for `schtasks `. What do you want to achieve ? – krisFR Mar 26 '15 at 15:36
  • /Y I guess should work as confirmation option – Yuriy Mar 26 '15 at 15:39
  • Confirmation for what ? Guessing is a thing, supported switches are another : https://technet.microsoft.com/en-us/library/cc725744(v=ws.10).aspx – krisFR Mar 26 '15 at 15:40
  • ok my mistake cmd see /y as a Syntax. But I need switches. In winXP xcopy command goes with switche /y (/y : Suppresses prompting to confirm that you want to overwrite an existing destination file.) – Yuriy Mar 26 '15 at 16:00
  • I have an error message even If i type schtasks /create /tn "Restart Ingenico" /tr "C:\IT_Dept\RestartShift4.bat" /sc daily /st 07:30 /y – Yuriy Mar 26 '15 at 16:01
  • Where /y is in another line – Yuriy Mar 26 '15 at 16:03
  • 2
    Ironically, the answers is already in the question: `Type "schtasks /create /?" for usage` – Esa Jokinen Mar 26 '15 at 16:30

1 Answers1

0

If you want to overwrite the task if it's already there, use the /F switch.

The switch is also explained in the schtasks /Create /? help and here.

mbirth
  • 101
  • 1