Computer Haven
https://computerhaven.com/forum/

Task Scheduler No Longer Working with SyncToy
https://computerhaven.com/forum/viewtopic.php?f=22&t=1800
Page 1 of 4

Author:  bbarry [ Sun Dec 17, 2017 11:34 am ]
Post subject:  Task Scheduler No Longer Working with SyncToy

I have been using Task Scheduler to automate my SyncToy backups on a weekly basis. Everything was working fine up until 11/16/17. Now Task Scheduler fails with a 'Last Run Result of (0x2). One recommended solution I found on the internet was to open the SyncToy task properties and ensure that I was running the task with 'highest privileges', which I was already doing.

I'm thinking that perhaps a Win 10 update might be the cause of my sudden problem. I am currently running Fall Creators Update version 1709.

I would appreciate any suggestions/advice on how to get Task Scheduler to once again run SyncToy in automated mode. Thanks in advance....

Author:  sboots [ Sun Dec 17, 2017 12:17 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

The code means -- The system cannot find the file specified.
What do you have set up for the task details?
The error suggests that the path to the program may not be properly specified.
Can you execute the task manually from task scheduler?
-steve

Author:  bbarry [ Sun Dec 17, 2017 12:30 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

Steve, thanks for your reply. I've got to leave the house for awhile but will try and answer your questions when I return. To my knowledge, I have not made any changes to the task since it last ran successfully on 11/16. But my system sometimes has a mind of its own, so you never know, lol.

Author:  jaylach [ Sun Dec 17, 2017 12:52 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

Looks like Steve beat me to the post. ;) I'm still going to leave mine as is but take any advice from Steve before mine.

First try running the task manually to see if it works. If not remove the task and set up again.

Second go to the executable for SyncToy, right click and go to Properties. Under the Compatibility tab select to run as admin.

If no success go on to the following.

This is actually an access denied error. The solution you stated is supposed to cure but obviously did not in your case so let's try something else...

Go to http://jaylach.com/downloads and grab the file 'Take Ownership'. Unzip and execute the registry hack to enable Take Ownership in your right click context menu. Right click on all folders that you are syncing and select to Take Ownership. A command prompt will open that automates permission settings, just let it run. Depending on how many files/folders are involved it can take a little time.

If you go through Event Viewer you MAY find the file/folder that is causing the issue.

You can also check the SyncToy logs. You can view the SyncToy log by opening SyncToy, and click on File->View log. Don't quote me on the path as I don't have SyncToy installed. I use GoodSync instead. It is not free but well worth the cost.
https://www.goodsync.com/
You can set the sync to go both directions or just one like a clone. The clone is what I use so my second system data is exactly the same as my main.

Author:  bbarry [ Sun Dec 17, 2017 4:01 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

sboots wrote:
The code means -- The system cannot find the file specified.
What do you have set up for the task details?
Per the instructs specified in SyncToy Help for scheduling, here is the program action detail:
"C:\\Program Files (86)\SyncToy 2.1\SyncToyCmd.exe -R"
And the trigger detail is:
At 6:30am every Sunday of every week starting 3/9/16

The error suggests that the path to the program may not be properly specified.
Can you execute the task manually from task scheduler?
No, at least not by highlighting the task and clicking on Run

But here is something odd that I don't fully understand. If I go to the SyncToy folder, there are two executable files:
SyncToyCmd.exe (this file doesn't do anything when I click on it)
SyncToy.exe (this file will run SyncToy when I click on it)

But I still can't run SyncToy from Task Scheduler....still get the (0x2) code. I've done more as discussed below in my response to Jay.

-steve

Author:  jaylach [ Sun Dec 17, 2017 4:21 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

I don't see a response...

Author:  bbarry [ Sun Dec 17, 2017 4:27 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

jaylach wrote:
Looks like Steve beat me to the post. ;) I'm still going to leave mine as is but take any advice from Steve before mine.
My response to Steve is shown above

First try running the task manually to see if it works. If not remove the task and set up again.
I can run SyncToy manually from the SyncToy folder, but not from within Task Scheduler. I have not yet removed the task and set it up again (I just now noticed that recommendation...sorry).
Second go to the executable for SyncToy, right click and go to Properties. Under the Compatibility tab select to run as admin.
As I told Steve, when I go to the SyncToy folder, there are two executables:
SyncToyCmd.exe (this file doesn't do anything when I click on it)
SyncToy.exe (this file will run SyncToy when I click on it)
If no success go on to the following.

This is actually an access denied error. The solution you stated is supposed to cure but obviously did not in your case so let's try something else...

Go to http://jaylach.com/downloads and grab the file 'Take Ownership'. Unzip and execute the registry hack to enable Take Ownership in your right click context menu. Right click on all folders that you are syncing and select to Take Ownership. A command prompt will open that automates permission settings, just let it run. Depending on how many files/folders are involved it can take a little time.
I did all the above without any difficulty; and yes, it did take awhile because of all the folders/files I had.
If you go through Event Viewer you MAY find the file/folder that is causing the issue.
I looked at the Event Viewer, but there is just too much stuff there for me to understand.
You can also check the SyncToy logs. You can view the SyncToy log by opening SyncToy, and click on File->View log.
I did look at these logs and there was nothing about a run using Task Scheduler. I did perform a manual SyncToy run earlier this morning, so there were some log notes pertaining to a couple of files they could not read from the Recycle Bin.

Don't quote me on the path as I don't have SyncToy installed. I use GoodSync instead. It is not free but well worth the cost.
https://www.goodsync.com/
I know you and Steve like this program, but the free SyncToy has served me well. It still works fine when I run it manually....I just can no longer get it to execute using Task Scheduler.

Unless you and/or Steve can tell me something else to try, I probably need to remove and reinstall the SyncToy task under Task Scheduler. That's what you meant, right? I shouldn't need to reinstall SyncToy since it works great manually.
You can set the sync to go both directions or just one like a clone. The clone is what I use so my second system data is exactly the same as my main.

Author:  bbarry [ Sun Dec 17, 2017 4:28 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

jaylach wrote:
I don't see a response...

I just posted it.....took me awhile to compose, lol.

Author:  jaylach [ Sun Dec 17, 2017 4:55 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

If you want to try running the executable as admin do both. SyncToy.exe is, as you know, what is used to get the interface on the screen. SyncToyCmd.exe, I believe, is what actually does the sync.

Steve and I did not mean if you could run SyncToy manually but if you could manually run the sync from within SyncToy not using Task Scheduler.

Author:  bbarry [ Sun Dec 17, 2017 5:07 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

jaylach wrote:
If you want to try running the executable as admin do both. SyncToy.exe is, as you know, what is used to get the interface on the screen. SyncToyCmd.exe, I believe, is what actually does the sync.

Steve and I did not mean if you could run SyncToy manually but if you could manually run the sync from within SyncToy not using Task Scheduler.

Jay, here's where I get confused because I don't know what you mean by "manually run the sync from within SyncToy". I have 6 folder pair that I want to backup to an external drive. If I open SyncToy, click on all 6 folder pair, and then click on Run.......everything works just fine. But when I try to automate this very process using Task Scheduler....that's when I get the (0x2) code.

Author:  jaylach [ Sun Dec 17, 2017 5:14 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

What you did, running the sync, is what was wanted. Just needed to confirm that the sync was still set properly.

Let's see what Steve says. Personally I'm surprised that you got SyncToy to work through Task Scheduler in the first place. I never did although I didn't try real hard.

Author:  bbarry [ Sun Dec 17, 2017 5:19 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

jaylach wrote:
What you did, running the sync, is what was wanted. Just needed to confirm that the sync was still set properly.

Let's see what Steve says. Personally I'm surprised that you got SyncToy to work through Task Scheduler in the first place. I never did although I didn't try real hard.

Thanks Jay. I'm going to take a break, wait and see what Steve says, and then maybe remove the task and set it up again under Task Scheduler. If that doesn't work, maybe I will try/purchase GoodSync.

Author:  jaylach [ Sun Dec 17, 2017 5:40 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

If you do end up buying GoodSync just get one license not one for each machine. One license is good for all involved machines.

Author:  sboots [ Sun Dec 17, 2017 9:37 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

I presume that this is a typo: "C:\\Program Files (86)\SyncToy 2.1\SyncToyCmd.exe -R"

There should only be one backslash...

However, I'd be setting the task up like this (after verifying that path to the exe):
Attachment:
Capture.JPG
Capture.JPG [ 44.52 KiB | Viewed 15740 times ]


-steve

Author:  bbarry [ Sun Dec 17, 2017 10:05 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

@ Steve - Yes that was a typo with the double backslash...sorry about that.

I removed my SyncToy task from Task Scheduler and set it up again. As you suggested, this time I put the -R argument where it said add arguments, rather than appending it directly to the script. Either way, it always ends up appended.

The Task Scheduler still didn't work, but I guess I'm making progress. This time I received a (0x1) error code, whatever that means.

I'm about ready to toss SyncToy and go with GoodSync....too much time wasted today on this issue.

But thanks to you and Jay for your help,

Author:  sboots [ Sun Dec 17, 2017 10:12 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

I *love* GoodSync, by the way. :-) I have been using it for years and abandoned SyncToy long ago. It is well worth buying -- I've purchased multiple licenses for it.

That said, although this is about a Windows Server scheduled task, it might apply here:
https://myousufali.wordpress.com/2012/0 ... error-0x1/

And:
Make sure Task Scheduler service and its dependent services are running. Task Scheduler service depends on Remote Procedure Call (RPC), DCOM Server Process Launcher and RPC Endpoint Mapper services.

-steve

Author:  bbarry [ Mon Dec 18, 2017 9:41 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

@ Steve & Jay -
I just hate to admit defeat when I encounter some of Microsoft's esoteric processes and tools. So I kept plugging away at SyncToy and finally got it to work with Task Scheduler. :rofl2:

I normally run Task Scheduler-SyncToy unattended, but I decided this time to observe the execution of SyncToyCmd.exe. Unfortunately, it moved pretty fast and cleared the screen before I had time to study the results. So I wrote a small batch file with a "pause" at the end so I could see what went on when Task Scheduler was working.

Specifically, here is my STBatch.bat file:
@echo off
"C:\Program Files (x86)\SyncToy 2.1\SyncToyCmd.exe" -R
pause

And here is my resulting Task Scheduler script:
C:\Users\BB\Documents\STBatch.bat

This task ran great (several times), and all my new & modified files were successfully backed-up to my external drive. After I observe a few more successful runs, I will remove the "pause" command from my batch file so that the process can be totally unattended.

Thanks again for all your help. And BTW, I am still going to purchase/use GoodSync, as I still don't totally trust SyncToy. Plus, I have been using RoboForm for years and really like that program.

Author:  jaylach [ Mon Dec 18, 2017 10:00 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

BB wrote:
Specifically, here is my STBatch.bat file:
@echo off
"C:\Program Files (x86)\SyncToy 2.1\SyncToyCmd.exe" -R
pause

And here is my resulting Task Scheduler script:
C:\Users\BB\Documents\STBatch.bat

Eloquent solution! Job well done. :urock:

Since your .bat file opens the Windows Command Prompt it MAY be that your Command Prompt has higher access levels.

If you are serious about buying GoodSync I don't know that I would use the same destination for both GoodSync and SyncToy. Steve may have better insight but I'd be worried that the two being used MIGHT cause a conflict.

Author:  bbarry [ Mon Dec 18, 2017 11:09 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

Thanks, Jay. I wasn't quite sure why my .bat file approach worked and the other didn't, but I was thinking it had something to do with 'higher access', which I kept reading about.

So you are suggesting I use a different external drive for GoodSync than I am currently using for SyncToy? Once I get the hang of using GoodSync, I will probably do away with SyncToy.....I've spent hours on that program that I will never get back.

Author:  sboots [ Mon Dec 18, 2017 11:12 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

There should be no issue with setting the same folder pairs in SyncToy and GoodSync, but I'd exclude (from each other) the files used by both programs to track changes and save copies of deleted files (assuming you have the option set in GoodSync). I would simply prevent them from running at the same time to avoid conflicts.
-steve

Author:  bbarry [ Mon Dec 18, 2017 11:17 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

sboots wrote:
but I'd exclude (from each other) the files used by both programs to track changes and save copies of deleted files (assuming you have the option set in GoodSync).
Steve, I guess I'm dense, but I have no idea what you are telling me here. Maybe it's because I haven't ever used GoodSync.
-steve

Author:  jaylach [ Mon Dec 18, 2017 11:29 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

Each program has to keep a sort of data base of what has been done so it is known what is what in relation to the last time ran. If such files are not protected from the other program it can cause problems. Not nearly as drastic but sort of like running two anti-virus programs at the same time.

Author:  bbarry [ Mon Dec 18, 2017 11:33 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

jaylach wrote:
Each program has to keep a sort of data base of what has been done so it is known what is what in relation to the last time ran. If such files are not protected from the other program it can cause problems. Not nearly as drastic but sort of like running two anti-virus programs at the same time.

So how do I know what and where these data base files are? How do I provide this protection?

Author:  jaylach [ Mon Dec 18, 2017 11:41 pm ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

bbarry wrote:
jaylach wrote:
Each program has to keep a sort of data base of what has been done so it is known what is what in relation to the last time ran. If such files are not protected from the other program it can cause problems. Not nearly as drastic but sort of like running two anti-virus programs at the same time.

So how do I know what and where these data base files are? How do I provide this protection?

Sorry but I have no idea, mayhaps Steve knows. You have to remember that I don't even have SyncToy installed.

This is why I suggested not having the same destination as that would reduce the risk of conflicts.

Here is what I would do... Install the trial for GoodSync and keep SyncToy. Set up different destinations and play. When you decide which you prefer get rid of the other. If Steve gives different advice please go with what he advises.

Author:  sboots [ Tue Dec 19, 2017 8:29 am ]
Post subject:  Re: Task Scheduler No Longer Working with SyncToy

bbarry wrote:
jaylach wrote:
Each program has to keep a sort of data base of what has been done so it is known what is what in relation to the last time ran. If such files are not protected from the other program it can cause problems. Not nearly as drastic but sort of like running two anti-virus programs at the same time.

So how do I know what and where these data base files are? How do I provide this protection?


Synctoy creates files in every folder you've set for Synchronzing. It's been some time, but SyncToyDirectoryId.txt appears to be the name. Also look for SyncToy_*.dat -- where * is replaced by a long string of characters.

Goodysnc creates folders within your sync pairs, optionally configured to be on only one of the sides of the pair, _gsdata_ which is used to keep track of status and retain backups of deleted copies.

-steve

Page 1 of 4 All times are UTC - 5 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/