Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Task Scheduler and Robocopy Batch Job

Reply
Thread Tools Display Modes

Task Scheduler and Robocopy Batch Job

 
 
bobneedshelp
Guest
Posts: n/a

 
      09-09-2007
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?

--
Bob
 
Reply With Quote
 
 
 
 
Andrew McLaren
Guest
Posts: n/a

 
      09-09-2007
"bobneedshelp" <> wrote ...
> 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,
--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
Jon
Guest
Posts: n/a

 
      09-09-2007

"bobneedshelp" <> wrote in message
news:CFADF926-43A1-4360-BB11-...
>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?
>
> --
> Bob




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.

--
Jon


 
Reply With Quote
 
bobneedshelp
Guest
Posts: n/a

 
      09-10-2007
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>
--
Bob


"Jon" wrote:

>
> "bobneedshelp" <> wrote in message
> news:CFADF926-43A1-4360-BB11-...
> >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?
> >
> > --
> > Bob

>
>
>
> 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.
>
> --
> Jon
>
>
>

 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      09-10-2007
"bobneedshelp" <> wrote ...
> 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 ...

--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
MartinBannister
Guest
Posts: n/a

 
      11-29-2007

I was experiencing this same problem triggering an access database with
command line parameters.

It turns out, after reading the posts here, that my problem was due to
being logged on as a different user to the one I was trying to run the
task as.

I originally decided to have these tasks run as the domain
administrator since I thought that was best for various permission
reasons. However these tasks run, close to the end of the day, when I
am still logged onto my machine and were returning the 2147750687 error
code.

Having changed the tasks to run using -my- user credentials (Or the
user currently logged on) they now run fine.

This may not help as you are trying to run over night and the PC is
likely to be logged off anyway. If not I would suggest making sure the
task is running as the currently logged on user and not someone else.

Martin.


--
MartinBannister
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Task Scheduler repeat task duration bug? sm02463 Windows Vista General Discussion 4 12-06-2008 06:40 PM
Task scheduler returns an error : the task image is corrupt ortamp Jean-David Windows Vista Performance 2 05-03-2008 02:02 PM
task scheduler doesn't start delayed task wuschba Windows Vista General Discussion 6 07-26-2007 08:06 AM
Task Scheduler: Repeat Task and Duration kirsch59 Windows Vista General Discussion 6 07-11-2007 09:01 PM
Task scheduler problem : task do not close Junkyard Engineer Windows Vista General Discussion 0 06-07-2007 01:51 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59