Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2393
  • Last Modified:

Win7 and 2008 R2 Task scheduler alternatives

Hi All, I have wasted many hours trying to setup simple backup scripts (bats) with robocopy that run
great on thier own, but not in Task Scheduler. It doesn't matter which account i use. Has anyone used a cheap replacement for Task scheduler and have it work dependably in a small network with win7 and server 2008r2 environment.
Thanks
0
RandyTech
Asked:
RandyTech
  • 7
  • 6
1 Solution
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
I haven't used a replacement for Task scheduler, but that's because everything I've run in it (including BAT files) has worked fine. I have found that the #1 reason for failures in Task Scheduler is because of highest privileges (elevated) not being selected. Go into Properties, then the General tab, and tick "Run with highest privileges":

Task Scheduler run elevated
See if that makes your BAT files work. Regards, Joe
0
 
RandyTechAuthor Commented:
I have tried all the scenarios.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
How does it fail when you run it with "Run only when user is logged on" and  "Run with highest privileges" both ticked? This is how I run all my batch files on numerous computers and I've never seen a failure due to Task Scheduler. So when you say a Task Scheduler to "work dependably", the Windows one has certainly done that for me. Can you post a sample BAT file that works fine when you run it manually but fails when you run it via TS?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
RandyTechAuthor Commented:
robocopy "c:\batch files" "k:\contacts" /e /r:5 /log:robolog.txt /tee
pause
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
How does it fail?

First thought is that maybe the log file is being written to a folder where writing is a problem. I suggest fully qualifying it to be certain where it is being written, so something like this:

/log:k:\robolog.txt

Point is, the log file folder may be assigned differently when run manually vs. run via TS if it's not fully qualified.

One other thought — /TEE may not make sense when run via TS. In other words, what is the console window when running it via TS?
0
 
RandyTechAuthor Commented:
no dos windows and ts just says that its running and it never stops.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
"no dos windows"

What do you mean by that?
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
One other idea — put the folder name where the script is located in the "Start in" field in TS:

task scheduler start in
0
 
Mohammed KhawajaManager - Infrastructure: Information TechnologyCommented:
Seems like K: is a mapped drive.  Have you tried it by using the UNC instead of drive letter (ie \\server1\shared) and you will replace k:\contacts with \\server1\shared\contacts.
0
 
RandyTechAuthor Commented:
K:\ is just a usb backup drive on the local PC.
0
 
RandyTechAuthor Commented:
I am sure that it is permission issues.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
> I am sure that it is permission issues.

One of my thoughts, too, which is why I asked this in an earlier post:

How does it fail when you run it with "Run only when user is logged on" and  "Run with highest privileges" both ticked?

You said:

ts just says that its running and it never stops

But I don't think that's the case. Although it says "Running" in the Status column, it probably isn't. You need to click the Refresh action on the right to update the Status. When you do that, it will likely go from "Running" to "Ready" (that's one of the changes in TS from XP — in XP, the Status is updated automatically; in W7, you need to click Refresh). Btw, I tested a BAT file here (W7/64-bit) with a robocopy command in it and it worked perfectly via TS.
0
 
RandyTechAuthor Commented:
The problem was that I was creating a Basic task. Once I created a regular task., it all worked.
Thanks for all of your help.
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
You're welcome. Happy to help. I was confident we'd get it working, as I had no problems with it here. Btw, you can wind up with the same task whether you start with Create Task or Create Basic Task. The only difference between those two is the wizard. In other words, even after creating a task with the Create Basic Task wizard, you can go into the properties for the task via the Properties link on the right and change whatever properties you want in the General, Triggers, Actions, Conditions, and Settings tabs. So you can wind up in the same place with the Create Basic Task wizard as you do with the Create Task wizard. The real key to the solution was getting the Properties set correctly. Regards, Joe
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now