Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Osaka, Japan
    Posts
    60
    Thanks
    2
    Thanked 3 Times in 2 Posts

    Unhappy Task scheduler not running my batch file

    Running Windows 8.1 Pro.

    I have some simple batch files that use robocopy to copy files from one local directory to another. I can execute the batch files manually from the command line.

    However, from the Task Scheduler they don't seem to run. The Task is running as the administrator account with highest privileges. The History shows that the task runs and completes without error. I had been running this Task for a month and just noticed that the data hadn't been updated in all that time. There are no errors logged.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,815
    Thanks
    19
    Thanked 107 Times in 101 Posts
    Have you tried setting up the Robocopy log to see whether there is anything interesting produced?
    How are you specifying the source and destination paths, i.e. are you using share names or drive letters? Giving one of the Robocopy command lines would help.

    Here's part of what works for me:

    CopyProf.png
    BATcher

    If it wasn't for the weather, Great Britain would be a silent nation.

  4. The Following User Says Thank You to BATcher For This Useful Post:

    bill (2014-04-17)

  5. #3
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    Did you create the task while logged into an account that is a member of the Administrators group?
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  6. #4
    Star Lounger
    Join Date
    Jan 2001
    Location
    Osaka, Japan
    Posts
    60
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Quote Originally Posted by BATcher View Post
    Have you tried setting up the Robocopy log to see whether there is anything interesting produced?
    How are you specifying the source and destination paths, i.e. are you using share names or drive letters? Giving one of the Robocopy command lines would help.
    Never considered the RoboCopy log. I'll try that.

    However, I'm just running the batch file, not invoking cmd the way you are. I had always just invoked my batch files directly in the past with Windows 7 & Vista & XP.
    scheduler-001.png
    I will try it your way first and see if that makes a difference.

    The batch file is essentially this:
    Code:
    CD "Q:\LogFiles\W3SVC1\"
    robocopy "Q:\LogFiles\W3SVC1" "D:\webs\logs\twins" /mir /xd "D:\webs\logs\twins\report" /w:0 /r:2
    Quote Originally Posted by bbearren View Post
    Did you create the task while logged into an account that is a member of the Administrators group?
    This task was made from an account with Admin privileges.

  7. #5
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,342
    Thanks
    14
    Thanked 227 Times in 181 Posts
    Invoke "C:\Windows\System32\Cmd.exe" (without the quotes) and then your batch file. "CD "Q:\LogFiles\W3SVC1" is unnecessary, as you have the source and target named in the command line.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  8. #6
    Star Lounger
    Join Date
    Jan 2001
    Location
    Osaka, Japan
    Posts
    60
    Thanks
    2
    Thanked 3 Times in 2 Posts

    Thumbs up RoboCopy log saves the day

    The suggestion to activate the RoboCopy log was just what I needed to troubleshoot this.

    It turned out that remote drives on my network that were mapped to drive letters were to blame. When running the batch files from Scheduler I needed the format \\192.168.1.113\E$\ instead.

  9. #7
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,815
    Thanks
    19
    Thanked 107 Times in 101 Posts
    I'm glad you got it to work!

    I would point out, though, that if your router (or perhaps server?) is handing out IP addresses via DHCP, then your 192.168.1.113 may change, and you'd be better using the computername, as in
    \\Bill-PC\E$\, which will be constant.
    BATcher

    If it wasn't for the weather, Great Britain would be a silent nation.

  10. #8
    Super Moderator jwitalka's Avatar
    Join Date
    Dec 2009
    Location
    Minnesota
    Posts
    4,558
    Thanks
    64
    Thanked 518 Times in 467 Posts
    Quote Originally Posted by BATcher View Post
    I'm glad you got it to work!

    I would point out, though, that if your router (or perhaps server?) is handing out IP addresses via DHCP, then your 192.168.1.113 may change, and you'd be better using the computername, as in
    \\Bill-PC\E$\, which will be constant.
    Many routers (including mine) allow you to reserve IP addresses for specific attached devices.

    Jerry

  11. #9
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,815
    Thanks
    19
    Thanked 107 Times in 101 Posts
    Hence why I qualified my statement with "if your router (or perhaps server?) is handing out IP addresses via DHCP"...!
    BATcher

    If it wasn't for the weather, Great Britain would be a silent nation.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •