Skip navigation

The more work I do, the more paranoid I become of possibly losing it all. I’ve got a pretty elaborate hardware setup in terms of disk storage, but I was lacking a simple, functional tool to do the backups of the data on a regular basis. I looked at Microsoft SyncToy for the backups, and it seems to do everything I need/want it to, except for one – scheduling. Their help documentation tells you to use their command-line application and the built in scheduler. This seems to do the trick, but there was one snag – it shows the ugly command prompt. This simply wouldn’t do….

I fired up Visual Studio 2008 and started writing a simple little .NET app to act as a wrapper for the command-line window. At the moment, it just runs all of your folder pairs, but I’ll be expanding the command line parsing to search for specific pairs. You’ll need the .NET Framework 2.0 installed for the software to work. Simply extract the file into the SyncToy directory, follow the help instructions for setting the scheduled task, but replace the program path with the following:

“C:Program FilesSyncToySyncToyHidden.exe” /hide /quiet

Obviously you’ll have to replace the path with the one that’s relevant to your system.

Please let me know if anyone runs into any troubles with the software.

Download Link

P.S. Thanks to jcarle for the help with the command line switches.

15 Comments

  1. This looks to be what i have been looking for.
    Would you be able to republish it please, when I follow the download link I get a 404.

    Many Thanks.

  2. Hi Robert,

    Sorry about the downtime. My files are stored on my Dreamhost account, and they recently moved my services to another server. I hadn’t got a chance to fix my DNS settings to the new address, but the download link should be working now.

    Let me know how things work!

    Cheers!

  3. Just wanted to thank you for this. It was a life saver! :D

  4. Thank you for this! I’ve been looking for something like this from early XP days. Works beautifully under Windows 7.

    The only change I needed to make was remove the double quotes around the path and change it to where I have SyncToy installed.

    Now …. how about a more generic program that will allow me to run batch files silently? One where I specify the fully qualified path to the program I want to run along with the parameters, as parameters to your program?

    Something like:

    runashidden d:foldernamemybatch.cmd /parm1 /parm2 ….

  5. Perfect… that popup was getting very annoying!

    Thanks very much! :)

  6. I’m trying to set this up as a scheduled task on remote PC but I keep getting run time errors an I can’t figure out what is causing it. Here is the error log. I’m not sure if it will help any.

    EventType clr20r3, P1 synctoyhidden.exe, P2 1.0.0.0, P3 49678b18, P4 synctoyhidden, P5 1.0.0.0, P6 49678b18, P7 42, P8 5, P9 system.nullreferenceexception, P10 NIL.

    Bucket 602284982, bucket table 5, EventType clr20r3, P1 synctoyhidden.exe, P2 1.0.0.0, P3 49678b18, P4 synctoyhidden, P5 1.0.0.0, P6 49678b18, P7 42, P8 5, P9 system.nullreferenceexception, P10 NIL.

  7. I wanted to run just one of my SyncToy profiles, so I created a VBscript to do it. This is less risky, and more flexible, than downloading an anonymous application from the internet.

    First, open Notepad and copy the code below into a new document. Be sure to substitute the name of your SyncToy profile for the part marked [NAME OF THE PROFILE TO RUN HERE].

    Save it somewhere convenient, like in the root directory of your user profile. Give it the extension “.vbs” (Be sure that when you save it, you change the Save As Type to “All Files,” otherwise you’ll end up with a file YOURNAME.vbs.txt)

    Next, in Task Scheduler, use the Action type “Start a program.” Browse to where you saved the script. Under “Add arguments,” use //B. If you want to limit the execution to a certain number of seconds, use the arguments //B //T:1800 (replace 1800 with the actual number of seconds you want to limit it to).

    Enjoy!

    —-Begin Code
    Const HIDDEN_WINDOW = 12

    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:” _
    & “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2″)
    Set objStartup = objWMIService.Get(“Win32_ProcessStartup”)

    Set objConfig = objStartup.SpawnInstance_
    objConfig.ShowWindow = HIDDEN_WINDOW
    Set objProcess = GetObject(“winmgmts:rootcimv2:Win32_Process”)

    Pth = “C:Program FilesSynctoy 2.1SynctoyCmd.exe”
    Flags = “-R “”[NAME OF THE PROFILE TO RUN HERE]“”"

    errReturn = objProcess.Create(Pth & ” ” & Flags, null, objConfig, intProcessID)
    wscript.echo errReturn

    —End Code—

  8. Thanks a mill, Nick. I’m only just setting up SyncToy 2.1, but after one scheduled run I knew I had to find a way to hide the command prompt. You da man!

  9. I thing http://andresantanna.webs.com/downloads.htm is what Rich is looking for. It meant to sync between 2 networked computers with synctoy (it monitors the networked computer state and runs synctoy just when available), but the parameter can be changed to anything.

  10. Thanks for this little program, very helpful.

  11. Any luck in getting it to be able to search for specific folder pairs? The command promt annoys the … out of me, but as long as this thing runs all folder pairs, I don’t think I can use it properly, as I want to run one sync process every five minutes, and a few of the others are rather heavy, and I want to run them far less often.

  12. Chad’s suggestion is near to what I’m looking for. If I copy & Paste your code then I get errors from Windows Script Host at the quotation marks. If I chnage the code to …

    Const HIDDEN_WINDOW = 12

    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:” _
    & “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2″)
    Set objStartup = objWMIService.Get(“Win32_ProcessStartup”)

    Set objConfig = objStartup.SpawnInstance_
    objConfig.ShowWindow = HIDDEN_WINDOW
    Set objProcess = GetObject(“winmgmts:rootcimv2:Win32_Process”)

    errReturn = objProcess.Create(“C:Program FilesSynctoy 2.1SynctoyCmd.exe -R”, null, objConfig, intProcessID)
    wscript.echo errReturn

    It all works. Trying to get the setup to work on a pair like “TV Shows” though, I just cannot get it to work …

    Const HIDDEN_WINDOW = 12

    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:” _
    & “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2″)
    Set objStartup = objWMIService.Get(“Win32_ProcessStartup”)

    Set objConfig = objStartup.SpawnInstance_
    objConfig.ShowWindow = HIDDEN_WINDOW
    Set objProcess = GetObject(“winmgmts:rootcimv2:Win32_Process”)

    errReturn = objProcess.Create(“C:Program FilesSynctoy 2.1SynctoyCmd.exe -R TV Shows”, null, objConfig, intProcessID)
    wscript.echo errReturn

    any help appreciated
    rgds mcdirt

  13. If anyone is interested, this line works :) finally …

    errReturn = objProcess.Create(“C:Program FilesSynctoy 2.1SynctoyCmd.exe -R” & “”"TV Shows”"”, null, objConfig, intProcessID)

  14. VBScript (somewhat counter-intuitively) uses two quotation marks in a row to denote a single quotation mark.

  15. Tks a lot, it works fine.
    As you mentioned, synctoy is a great tool but having a cmd window popup every 60 minutes is so annoying.

    The right place to put /hide /quiet setting is in the Add Arguments textbox, like this:
    /hide /quiet -R “folderpairname”


2 Trackbacks/Pingbacks

  1. [...] thanks to a bit of Googling, I found a solution. It’s a little NET application someone wrote that acts as a wrapper for SyncToyCmd.exe and [...]

  2. By Radical Robot on 13 Dec 2011 at 3:40 am

    [...] Post on The Rolled-Up Newspaper! On The Rolled-Up Newspaper Liked Hiding Microsoft SyncToyCmd for backups | Zxian.org on [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>