# Problem with schtask.exe



## laukejas (Aug 1, 2010)

Hello,

I'm attempting to create a task via schtask.exe with "wake computer to run this task" enabled. I can't find out how. Two things I tried:

1. Create a task via schtasks.exe (in cmd) with parameters to check "wake computer to run this task". In internet documentation, it is written that there is not parameter for that.

2. Since my task is set to schedule (ONCE, time and date), I tried creating task in Task Scheduler manually, checking "wake computer to run this task" via GUI, and then changing it's start time via schtasks.exe with parameters "schtasks /Change /ST 22:30:00 /SD 2010/08/08 /TN MYTASK". I get error "parameter is incorrect". Guy on another forum told me that it is impossible to change start time and date via Schtasks.exe (really? in schtasks /change /? help file this command is listed as available).

So, what should I do? Where is my mistake?


----------



## laukejas (Aug 1, 2010)

Bump. Come on, people, please...


----------



## laukejas (Aug 1, 2010)

Bump. Help me, please... I'm totally stuck.


----------



## hal8000 (Dec 23, 2006)

laukejas said:


> Hello,
> 
> I'm attempting to create a task via schtask.exe with "wake computer to run this task" enabled. I can't find out how. Two things I tried:
> 
> ...



What you need to do is type your command in the command prompt then post the error message you are seeing. It may be that you are using wrong date format.

Bear in mind two things:
Internationalisation: date format 2010/08/08 assumes your locale is set for yyyy/mm/dd 
If you want to wake your computer, make sure it is in one of the sleep states, hiberbation or suspend


----------



## laukejas (Aug 1, 2010)

I already written that. Here I repeat:

1. I open CMD.
2. Write schtasks /Change /ST 22:30:00 /SD 2010/08/08 /TN MYTASK" and press return
3. get message "error: the parameter is incorrect".

If I try to use different date format, CMD notifies me of this error, and writes how I should write date - yyyy/mm/dd.

So?


----------



## hal8000 (Dec 23, 2006)

laukejas said:


> I already written that. Here I repeat:
> 
> 1. I open CMD.
> 2. Write schtasks /Change /ST 22:30:00 /SD 2010/08/08 /TN MYTASK" and press return
> ...


Typical windows error message - none too helpful.

Check that the Task Scheduler service is running. Click start, run,type services.msc and hit <enter>. Scroll down the list to this service and click on it. The left column dialog should indicate if it is running or needs to be restarted.

If running, restart service and type your command again.


----------



## laukejas (Aug 1, 2010)

Task Scheduler service is running, but all options is greyed out - obviously Windows doesn't want me to tamper with it. So I can't change a thing. But the service is running correctly - scheduled tasks are launching normally.

Try the command line I have problem with on your computer, and tell me the results. Do you get the same error?

And... Thanks for trying to help


----------



## laukejas (Aug 1, 2010)

Strange thing! I just tried creating new task from command line, and than changing it's time - and it works! Strangely enough, even though all settings for task created via GUI and via CMD are the same, I can change one, but get error with another. Any ideas why CMD can't edit task created via GUI?


----------



## laukejas (Aug 1, 2010)

Any comments?


----------



## johnwill (Sep 26, 2002)

http://efreedom.com/Question/1-4979...rameter-Will-Wake-Computer-Sleep-Execute-Task

Apparently, you can create an XML file to do any advanced options you like by editing the XML file before creating the task.


----------

