views:

3751

answers:

3

I am having major problems getting a scheduled task to run. The task is created fine using the ITaskScheduler interface provided by Microsoft. The task is set to run only if a user is logged on.

The problem is that the task does NOT run and the log file SchedLgU.txt cites the reason as being:

"The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task.

The specific error is:

0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated."

I know for a fact that a scheduled task can be created with no account information because the Google Updater scheduled task does this, and it runs fine.

All I can gather from web searches is that Windows has a "scheduled task database" that needs to have credential information for each task for it to be able to run.

Does anyone know how to modify this credential database or any other way to get my task to run?

+1  A: 

As far as I know, and the documentation backs this up, an account is required for a scheduled task. If you set the task to run only when a user is logged in that only means a password is not necessary, you still need an account. This account can be set to a group so that the task will be run when it is triggered as long as anyone in the group is logged on. For instance you can set the account to 'Users' so that the task can run when anyone is logged on.

Stephen Martin
Unfortunately that does not work. Setting "Users" as the user name with a blank password results in the task getting a user name field of "BUILT-IN\Users". However, the task fails to start with an error indicating invalid user name or password.
Using a group account works fine in Vista and Windows 2008 but may not have been added as of XP or 2003, I don't remember when it was added. The requirement to have an account is still valid though.
Stephen Martin
Sorry, this was one of the numerous additions included with the big upgrade to Task Scheduler 2.0 that came with Vista. If you are using XP or 2003 you are out of luck.
Stephen Martin
Yes, I am using XP. Thank you for checking into this, Stephen; I appreciate it.
+2  A: 

you could use batch scripting.

schtasks /create /tn UNO /tr YOURAPP.EXE /sc HOURLY /mo 2

there you go.

read: How to use Schtasks.exe to Schedule Tasks in Windows Server 2003

GerManson
+3  A: 

The GoogleUpdateTaskMachine Task uses the "NT AUTHORITY\SYSTEM" to Run the task. You can do this by using schtasks command and the /ru switch with "System" or "" as the parameter. Like this:

schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /d 15 /ru "System"

It does not prompt for a password.

See technet for more info.

David Glass
Why was this voted down? I voted it back up.
Greg