I need assistance with the Task Scheduler feature in my software.
I need assistance with the Task Scheduler feature in my software.
I use Sync Toy to back up my PCs every night. I have three computers total, two with Windows 11 and one with Windows 10. All three are on Enterprise editions of the software. They are all set to run automatically at midnight using Task Scheduler. One of my Windows 11 machines is not running Sync Toy through Task Scheduler, so I don't know why. The Task Scheduler settings look identical on all three PCs, except for which user account runs them. On this specific machine, that account belongs to an Administrator group, just like it is on the other two PCs. Sync Toy works fine outside of Task Scheduler, but when using Task Scheduler, it starts running and then stops after about one second. I think there must be something different in Windows itself, though I can't figure out where to look if that's the issue because I've already checked everything else. Here is a copy of the Task Scheduler entry so you can check it:
That 2015 date is just when I first started making this task. Originally, I only set up SyncToy on one computer back in 2015. All the TaskScheduler events I'm using came from my original Windows Home Server 2011 File-Server build. I imported that task onto the File Server after I rebuilt it and put Win11 Ent Ed on it, and it still works there. I also imported that same task into my Win10 Ent Ed PC, and it works there too. It's only on one of my other Win11 PCs where it isn't running properly. I imported the task from the same export file I used for the other PCs, but of course changed the trigger time and the account it runs with. That account is the main Admin account on that PC, along with all the other settings being the same. I checked the Task Scheduler settings of the non-working task compared to the working ones too, and they were basically identical except for those two things mentioned before. Even when I recreated the event from scratch following the steps of one of the working PCs, it did nothing different. Honestly, I can't imagine this being a problem with the task itself. I exported all the Event Viewer info so you can take a look at it but the only event that shows up matching the 3:30am trigger is in the Security log. It just shows two successful "logon" entries and then a "special logon," but these are basically the same when compared against the security events from one of the working computers whose trigger time is at 11:30pm. I'm also attaching that export file as well for clarity. Task Scheduler seems to think the event is running successfully, if you look at the history tab of the task, but it doesn't actually run. If you look at the history info I exported, it says "task completed" but the length of time it runs is just 1 or 2 seconds, meaning it clearly didn't run.
The EV files seem to require downloading to view.... This is not part of my standard procedures. Re: "task completed". Sync Toy is doing some sort of testing, and for non-working computers, it might decide that no backups are needed - just for whatever reasons.... So Sync Toy actually stops running after 1 or 2 seconds. Three quick things we can do: 1) Is there a "clock" on the destination drive or computer for the backups? Check if all computers get and use a common source for date and time, and make sure those dates and times are correct for your area. Just to test/learn something, change the trigger time for the non-working computer from 3:30 a.m. to the "working" time of 11:30 p.m., which is used by the two working computers. My idea is that something on the process used by the non-working computer thinks (because of some time or date differences) that the sync has already been done and just stops after 1 or 2 seconds. 11:30 p.m. being one day/date and 3:30 a.m. being the next day/date..... 2) I think Event Viewer gives us some clues, so keep watching the logs there. But add Process Explorer (Microsoft, free) to watch and compare what happens when Sync Toy is triggered. Open the Process Explorer window on both the working computers and the non-working computer. Leave it open so we can see what happens or doesn't happen when Sync Toy starts running. I would expect to see a process briefly appear and disappear on the non-working computer. 3) Remember to look in Reliability History/Monitor on all three computers. Reliability History is much friendlier for regular users and might show patterns using the timeline format. Compare what happens on the working computer's pattern to the pattern of the non-working computer. https://learn.microsoft.com/en-us/sysint...s-explorer Lastly: if there is a specific part of an Event Viewer log you are looking at, just copy and paste that section into this post instead of needing a file download. Just make sure to label which log you are using so we know the source computer and highlight the lines you want to see.
I figured out the problem at last. The computer that wasn't working had its source drives on another machine. I connected those network drives to the PC and created folder pairs based on where they were mapped. That works for SyncToy.exe, but it won't work for SyncToyCMD.exe. Once I changed the source paths from the mapped drive to actual network paths (like \\server\drive), everything worked without any problems. Just FYSA, if SyncToy actually runs from Task Scheduler, it takes at least 2.5 to 3 minutes just to scan even a 500GB folder to see if anything changed. Your idea that it only needs seconds isn't true. Thanks for helping me out.