diff --git a/WpkgInstaller/WpkgInstaller.cs b/WpkgInstaller/WpkgInstaller.cs
index 0fe678312e030e0a1560e86ffc80e078b5a8cacc..2493a871ba17487649628eea2a495479a0bfc34f 100755
--- a/WpkgInstaller/WpkgInstaller.cs
+++ b/WpkgInstaller/WpkgInstaller.cs
@@ -2,6 +2,7 @@
 using System.ServiceProcess;
 using System.Diagnostics;
 using System;
+using System.Threading;
 
 namespace WpkgInstaller
 {
@@ -81,6 +82,56 @@ namespace WpkgInstaller
             eventLog.WriteEntry("Service stopped", EventLogEntryType.Information);
         }
 
+        private void RunWpkgSync()
+        {
+            eventLog.WriteEntry("Starting sync", EventLogEntryType.Information);
+
+            Thread thWorker = new Thread(new ThreadStart(delegate
+            {
+                Process process = new Process();
+                ProcessStartInfo startInfo = new ProcessStartInfo()
+                {
+                    RedirectStandardInput = true,
+                    RedirectStandardOutput = true,
+                    RedirectStandardError = true,
+                    WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
+
+                    FileName = Environment.GetEnvironmentVariable("comspec"),
+                    Arguments = "/C \\\\wpkg.ch.cam.ac.uk\\wpkg\\wpkg.cmd /synchronize",
+                    WorkingDirectory = Environment.GetEnvironmentVariable("temp"),
+
+                    UseShellExecute = false,
+                };
+
+
+                process.StartInfo = startInfo;
+
+                process.EnableRaisingEvents = true;
+                process.OutputDataReceived += WriteDataToLog;
+                process.ErrorDataReceived += WriteDataToLog;
+
+                process.Start();
+                process.BeginErrorReadLine();
+                process.BeginOutputReadLine();
+                process.WaitForExit();
+
+                String msg = String.Format("sync done with exit code {0}", process.ExitCode);
+                eventLog.WriteEntry(msg, EventLogEntryType.Information);
+            }));
+
+            thWorker.Start();
+         
+        }
+
+        private void WriteDataToLog(object sendingProcess, DataReceivedEventArgs e)
+        {
+            if (e != null)
+            {
+                eventLog.WriteEntry(e.Data, EventLogEntryType.Information);
+            }
+
+        }
+
         private void eventLog_EntryWritten(object sender, System.Diagnostics.EntryWrittenEventArgs e)
         {