Results 1 to 6 of 6

Thread: Task Scheduler and Robocopy Batch Job

  1. #1
    bobneedshelp Guest

    Task Scheduler and Robocopy Batch Job

    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

  2. #2
    Andrew McLaren Guest

    Re: Task Scheduler and Robocopy Batch Job

    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

  3. #3
    Jon Guest

    Re: Task Scheduler and Robocopy Batch Job

    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.

  4. #4
    bobneedshelp Guest

    Re: Task Scheduler and Robocopy Batch Job

    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>

  5. #5
    Andrew McLaren Guest

    Re: Task Scheduler and Robocopy Batch Job

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

  6. #6
    MartinBannister Guest

    Re: Task Scheduler and Robocopy Batch Job


    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

Similar Threads

  1. FTP Upload batch file doesn't work properly in Task Scheduler
    By supphavith09 in forum Windows Server Help
    Replies: 1
    Last Post: 09-02-2012, 07:39 AM
  2. Replies: 5
    Last Post: 29-09-2011, 01:03 PM
  3. Task scheduler - anyone??
    By Jay in forum Vista Help
    Replies: 6
    Last Post: 04-11-2009, 05:49 AM
  4. Batch file for Daily backup with Robocopy
    By Dave Allen in forum Windows Server Help
    Replies: 3
    Last Post: 08-01-2009, 09:05 PM
  5. Delete task from Task Scheduler
    By Jimbo in forum Vista Help
    Replies: 2
    Last Post: 05-03-2008, 09:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,017,079.32646 seconds with 17 queries