7

I need to enable a schedule task through a batch file, this schedule task is set to run every 2 mins once enabled. Using SCHTASKS /Run -- run the task but only once it does not care about the schedule i.e to run every 2 mins

I need to do this through a batch file. I am using Windows 2003 server.

Please guide.

1
  • 1
    I cun't find something, so if there are any options to enable the schduled task using c# code. Jun 16, 2011 at 13:25

3 Answers 3

9
schtasks /change /tn "TaskNameGoesHere" /ENABLE
5
  • If you read more into his question, he needs one created not an existing one altered. Jun 16, 2011 at 20:43
  • I think you're wrong, he is talking about an existing task which is scheduled to run every 2 minutes. But lets wait for the op to clarify.
    – ba__friend
    Jun 16, 2011 at 20:54
  • 1
    /ENABLE A value that enables the scheduled task. An enabled task can run, and a disabled task cannot run. Windows XP and Windows Server 2003: This option is not available. Jun 16, 2011 at 21:08
  • /ENABLED worked for me on windows Server 2003. I am using /Enable and /Disable. Thanks all for help. Yes it is an existing task and also I am SHE :-) Jun 17, 2011 at 10:36
  • /ENABLED didn't work for me on WinXP, in case anyone still cares ;) Oct 28, 2015 at 15:49
6

You can do it in Batch. You can use schtasks /? or visit http://ss64.com/nt/schtasks.html. You can get very granular with your options and there are many switches available to use. Customize to your heart's desires.

2
3

You can do this by at command

Example:

at 10AM every:SU "C:\Program Files\VideoLAN\VLC\vlc.exe"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.