Argh, SyncToy *will not* run as scheduled!

Soldato
Joined
20 Oct 2002
Posts
18,799
Location
London
This is so frustrating! I'm trying to setup a simple backup/clone of a works folder and have setup SyncToy. Nice bit of software, does exactly what i want with no fuss. I can run it fine, manually. But i cant for the life of me get it to run using Scheduled Tasks. I've tried every manner of the command and it just doesn't seem to want to work.

Oddly enough, running it in the cmd line doesn't seem to work either. If i try to run this manually:
Code:
"C:\Program Files\Microsoft\SyncToy 2.1\SyncToyCmd.exe" -R
..I just get a black cmd window running that, but nothing happens :confused:

Can anyone help? I'm running Vista on this particular machine but am going to try exactly the same on a Win7 machine (both backing up to a Win7 machine)
 
Does SyncToy require admin rights to run? I can't remember myself. When creating the scheduled task did you give it proper credentials to run as? [it doesn't like blank passwords iirc].
 
Yep i have. There's only one user on the PC and that's setup as admin.

Now if i run the task manually (but through Task Scheduler) i get a black cmd box that is titled taskeng.exe. I'm now trying to figure out if it is actually running SyncToy or not :confused:
 
If you're on Vista/W7/Server 2008 check the history tab in the task scheduler to see what it did.

On other OSs it might be in the event log.
 
Oddly enough, running it in the cmd line doesn't seem to work either. If i try to run this manually:
Code:
"C:\Program Files\Microsoft\SyncToy 2.1\SyncToyCmd.exe" -R
..I just get a black cmd window running that, but nothing happens :confused:
Is the folder pair (or pairs) you're trying to sync set as Active For Run All in the options? What happens when you specify a folder pair name after the -R?
 
Open synctoy, view the log and clear it, run your scheduled task... check the log again

should tell you if its working or not
 
Hmn thanks guys. Seems to work now. The taskeng.exe cmd box i was getting up seemed to be actually running it. It just didnt show me anything. I've tested a couple of times and when i run the task it does copy over new test folders i've made. So all's good in the hood :cool:

EDIT: Excellent. All working on an XP machine now.

Now here's a question. I'm sure my boss won't be ecstatic about most of our machines being left on 24/7 just to do this every night, so can i schedule them to shutdown after that task has finished? There must be a way..!
 
Last edited:
shutdown /s

what you should do it create a 'synctoy.bat' file in notepad.

Just open notepad


paste this in to the window..

"C:\Program Files\Microsoft\SyncToy 2.1\SyncToyCmd.exe" -R
shutdown /s


Save the file as synctoy.bat (not synctoy.bat.txt)

it will run synctoy first, then once it's done, it will shutdown the pc.

Then schedule the bat file as the program that needs to run
 
Thanks bledd. But do you mean shutdown -s?

I found how to schedule the shutdown separately and I have it running the following:

C:\WINDOWS\system32\shutdown.exe -f -s -t 00

-f to close all programs, -s to shutdown, -t to shutdown after 00 seconds.

I set that to run an hour after my SyncToy, and only if the PC is idle for more than 45mins (i.e. the SyncToy is finished). But i much prefer your idea. Will it work for XP, Vista and Win7? There's no chance of it trying to shutdown whilst files are still copying is there?
 
on this windows 7 machine

shutdown /? shows

/s as the shutdown command

probably different in XP and Vista/7 or something, I can't remember



if you have it running in the same bat file, it won't run the shutdown command until synctoy is finished. bat files can only do one task at a time, they work from top to bottom one job at a time, once the exe closes, it'll run the next thing in the list. so there's no need to guess how long synctoy will take to run, just get it to shutdown after it's done.


if it's a work environment, I like to use robocopy instead of synctoy, it's a single EXE.

comes with vista/7, here is one for XP http://bleddyn.co.uk/creations/ROBOCOPY.EXE -chuck that EXE into C:\Windows\system32\


You can get it direct from Microsoft, but it's a pain to extract it from their site.



Robocopy is commandline only.

But it can do what synctoy does, and more
 
Last edited:
It would appear /s and -s are interchangeable in XP. I would go with /s though so you know the script works with Vista/7.
 
Thanks guys. I came in this morning to find my backups done on all 3 machines and they were all shutdown as well. Woop woop :)

My next question. They're all backing up to another Win7 machine (just another desktop with a specified backup partition). If i set that machine to have a scheduled task to shutdown ~1hr after the backups are due, but importantly only when it has been idle for.. say.. 20mins, will that work?

I mean to say, will it recognise that the machine is not idle when the backups are being transferred to it? I don't want it shutting down halfway through the backup!
 
you can add the shutdown command for that pc to another one..

test it like this..

shutdown /s /m \\COMPUTERNAME (of the one you want to shutdown)


so put that line in the bat file of the last pc that runs it's backup
 
Ah genius. Although it does mean i need to stagger the backups and hope that the last one i schedule is actually the last one to finish. Hmn.

EDIT: Hmn it says 'Access Denied'. After a spot of Googling it seems I need Admin rights on the PC i'm trying to shutdown. If i try \\ComputerName\C$ it shows me a login window. I can't get in with the existing account on the PC i want to shutdown, because it puts STEVE/ in front of whatever username i try to type. Steve is the PC i'm using to shutdown the other PC. Hmn.
 
Last edited:
Back
Top Bottom