Task Scheduler and Robocopy Batch Job

G

Guest

I would like to schedule Robocopy to copy files from my PC to an external
hard drive. I have created a batch file that does this and it runs from the
command line. This works well when I am logged in; however, I would like it
to "Run whether user is logged on or not". I have tried setting it with
"highest privileges"; however I can't get it to run in this mode.

In the History tab, I see an Error with Error Value: 2147750687. The
Operational Code is 6619136. It also has a Task Category of "Task Start
Failed". I would guess this is security related. I have the task scheduled
under an administrator account. The Logon as batch job is true for
administrators.

Any thoughts as to what I can try to get a simple Batch Job running with
Task Scheduler so that it can run in the middle of the night?
 
A

Andrew McLaren

bobneedshelp said:
In the History tab, I see an Error with Error Value: 2147750687. The
Operational Code is 6619136. It also has a Task Category of "Task Start
Failed". I would guess this is security related. I have the task
scheduled

Hi Bob,

Can you double-check that error code? I don't recognise "2147750687" as a
well-known HRESULT. In fact, in that form it would be an informational
message, not an error message (error HRESULTs are negative, usually in the
form -214nnnnnn).

If you double-click the Event on Event Viewer, it will appear in a dialogue
box with a "Copy" button. You can then copy-n-paste the exact text of the
event into a reply message.

The Task Scheduler service writes a text log file as it runs, called
C:\Windows\Tasks\SchedLGU.txt You might find some additional diagnostic
information in this file (and if so, copy it to a reply mesage to the
newsgroup).

Once we have an HRESULT we can decode, that should give us a better idea of
exactly what failed.

Regards,
 
J

Jon

bobneedshelp said:
I would like to schedule Robocopy to copy files from my PC to an external
hard drive. I have created a batch file that does this and it runs from
the
command line. This works well when I am logged in; however, I would like
it
to "Run whether user is logged on or not". I have tried setting it with
"highest privileges"; however I can't get it to run in this mode.

In the History tab, I see an Error with Error Value: 2147750687. The
Operational Code is 6619136. It also has a Task Category of "Task Start
Failed". I would guess this is security related. I have the task
scheduled
under an administrator account. The Logon as batch job is true for
administrators.

Any thoughts as to what I can try to get a simple Batch Job running with
Task Scheduler so that it can run in the middle of the night?



I have a feeling that you have to schedule the 'run whether user is logged
on or not' type tasks with the System account, rather than your own. You may
wish to play with that suggestion.
 
G

Guest

The log had no information in it about this task. Here is the exact error
message that occurs. User "Bob" is the adminstrator.

Log Name: Microsoft-Windows-TaskScheduler/Operational
Source: Microsoft-Windows-TaskScheduler
Date: 9/9/2007 6:01:00 PM
Event ID: 101
Task Category: Task Start Failed
Level: Error
Keywords:
User: SYSTEM
Computer: BlackComputer
Description:
Task Scheduler failed to start "\Bob Tasks\test task" task for user
"BlackComputer\Bob". Additional Data: Error Value: 2147943645.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-TaskScheduler"
Guid="{de7b24ea-73c8-4a09-985d-5bdadcfa9017}" />
<EventID>101</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>101</Task>
<Opcode>101</Opcode>
<Keywords>0x8000000000000000</Keywords>
<TimeCreated SystemTime="2007-09-09T23:01:00.002Z" />
<EventRecordID>380888</EventRecordID>
<Correlation />
<Execution ProcessID="1100" ThreadID="1620" />
<Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
<Computer>BlackComputer</Computer>
<Security UserID="S-1-5-18" />
</System>
<EventData Name="TaskStartFailedEvent">
<Data Name="TaskName">\Bob Tasks\test task</Data>
<Data Name="UserContext">BlackComputer\Bob</Data>
<Data Name="ResultCode">2147943645</Data>
</EventData>
</Event>
 
A

Andrew McLaren

bobneedshelp said:
The log had no information in it about this task. Here is the exact error
message that occurs. User "Bob" is the adminstrator.

<EventData Name="TaskStartFailedEvent">
<Data Name="TaskName">\Bob Tasks\test task</Data>
<Data Name="UserContext">BlackComputer\Bob</Data>
<Data Name="ResultCode">2147943645</Data>
</EventData>

Ah, that looks better. 2147943645 is a standard Windows HRESULT, defined in
Winerror.h:

# as an HRESULT: Severity: FAILURE (1), FACILITY_WIN32 (0x7), Code 0x4dd
# for decimal 1245 / hex 0x4dd
ERROR_NOT_LOGGED_ON
# The operation being requested was not performed because the
# user has not logged on to the network.
# The specified service does not exist.

So, it looks like the Task was unable to run because its user context,
BlackComputer\Bob, was not logged on. But, I guess you have the "Run whether
the user is logged on or not" option selected. So it's still a bit
perplexing ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top