24

I can create a task from command line like this:

schtasks /create /tn SomeTask /tr "do.bat arg1 arg2" /sc ONCE /st 00:00:00 /sd 01/01/1991 

and now I need to delete it. However the command needs to be confirmed and I don't know how to do that from BATCH file (bat/cmd).

C:\> schtasks /delete /tn ContextSwitchTask WARNING: Are you sure you want to remove the task "ContextSwitchTask" (Y/N)? C:\> echo Y | schtasks /delete /tn ContextSwitchTask WARNING: Are you sure you want to remove the task "ContextSwitchTask" (Y/N)? Y ERROR: Invalid input. Type "SCHTASKS /DELETE /?" for usage. 

Question: How to delete scheduled task and force yes?

1 Answer 1

28
C:\> schtasks /delete /tn ContextSwitchTask /f 
1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.