Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp	(revision 22808)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp	(revision 22809)
@@ -140,4 +140,13 @@
     *ppszValue = NULL;
 
+    char *pszPropNameUtf8;
+    rc = RTStrCurrentCPToUtf8(&pszPropNameUtf8, pszPropName);
+    if (RT_FAILURE(rc))
+    {
+        VBoxServiceError("Exec: Failed to convert property name %s to UTF-8: %Rrc",
+                         pszPropName, rc);
+        return rc;
+    }
+
     for (unsigned cTries = 0; cTries < 10; cTries++)
     {
@@ -156,5 +165,5 @@
         char    *pszFlags;
         uint64_t uTimestamp;
-        rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropName,
+        rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropNameUtf8,
                                  pvBuf, cbBuf,
                                  &pszValue, &uTimestamp, &pszFlags, NULL);
@@ -202,4 +211,5 @@
 
     RTMemFree(pvBuf);
+    RTStrFree(pszPropNameUtf8);
     return rc;
 }
@@ -284,5 +294,5 @@
 
             /* add it */
-            papszArgs[cUsed++] = RTStrDupN(pszArgs, (uintptr_t)pszEnd - (uintptr_t)pszArgs);
+            papszArgs[cUsed] = RTStrDupN(pszArgs, (uintptr_t)pszEnd - (uintptr_t)pszArgs);
             if (!papszArgs[cUsed++])
                 break;
@@ -327,5 +337,4 @@
     for (;;)
     {
-#if 0 /** @todo r=bird: This code needs reviewing and testing before it can be enabled. */
         if (!fSysprepDone)
         {
@@ -342,5 +351,5 @@
                 rc = VERR_NOT_FOUND;
 #else
-            /* Predefined sys. */
+            /* Predefined sysprep. */
             int  rc = VINF_SUCCESS;
             char szSysprepCmd[RTPATH_MAX] = "C:\\sysprep\\sysprep.exe";
@@ -350,9 +359,9 @@
             if (    GetVersionEx((LPOSVERSIONINFO) &OSInfoEx)
                 &&  OSInfoEx.dwPlatformId == VER_PLATFORM_WIN32_NT
-                &&  OSInfoEx.dwMajorVersion >= 6 /* Vista */)
+                &&  OSInfoEx.dwMajorVersion >= 6 /* Vista or later */)
             {
-                rc = RTEnvGetEx(RTENV_DEFAULT, "windir", szSysPrepCmd, sizeof(szSysPrepCmd), NULL);
+                rc = RTEnvGetEx(RTENV_DEFAULT, "windir", szSysprepCmd, sizeof(szSysprepCmd), NULL);
                 if (RT_SUCCESS(rc))
-                    rc = RTPathAppend(szSysPrepCmd, sizeof(szSysPrepCmd), "system32\\sysprep\\sysprep.exe");
+                    rc = RTPathAppend(szSysprepCmd, sizeof(szSysprepCmd), "system32\\sysprep\\sysprep.exe");
             }
             pszSysprepExec = szSysprepCmd;
@@ -399,9 +408,19 @@
                                      * Store the result in Set return value so the host knows what happend.
                                      */
-                                    rc = VbglR3GuestPropWriteValueF(g_uExecGuestPropSvcClientID,
-                                                                    "/VirtualBox/HostGuest/SysprepRet",
-                                                                    "%d", Status.iStatus);
+                                    char* pszValueUtf8;
+                                    rc = RTStrCurrentCPToUtf8(&pszValueUtf8, "/VirtualBox/HostGuest/SysprepRet");
                                     if (RT_FAILURE(rc))
-                                        VBoxServiceError("Exec: Failed to write SysprepRet: rc=%Rrc\n", rc);
+                                    {
+                                        VBoxServiceError("Exec: Failed to convert SysprepVBoxRC name to UTF-8: rc=%Rrc\n", rc);
+                                    }
+                                    else
+                                    {
+                                        rc = VbglR3GuestPropWriteValueF(g_uExecGuestPropSvcClientID,
+                                                                        pszValueUtf8,
+                                                                        "%d", Status.iStatus);
+                                        if (RT_FAILURE(rc))
+                                            VBoxServiceError("Exec: Failed to write SysprepRet: rc=%Rrc\n", rc);
+                                        RTStrFree(pszValueUtf8);
+                                    }
                                 }
                                 else
@@ -424,5 +443,5 @@
                     RTStrFree(pszSysprepArgs);
                 }
-#ifndef SYSPREP_WITH_CMD
+#ifdef SYSPREP_WITH_CMD
                 RTStrFree(pszSysprepExec);
 #endif
@@ -437,12 +456,21 @@
             {
                 VBoxServiceVerbose(1, "Exec: Stopping sysprep processing (rc=%Rrc)\n", rc);
-                rc = VbglR3GuestPropWriteValueF(g_uExecGuestPropSvcClientID, "/VirtualBox/HostGuest/SysprepVBoxRC", "%d", rc);
+
+                char* pszValueUtf8;
+                rc = RTStrCurrentCPToUtf8(&pszValueUtf8, "/VirtualBox/HostGuest/SysprepVBoxRC");
                 if (RT_FAILURE(rc))
-                    VBoxServiceError("Exec: Failed to write SysprepVBoxRC: rc=%Rrc\n", rc);
+                {
+                    VBoxServiceError("Exec: Failed to convert SysprepVBoxRC name to UTF-8: rc=%Rrc\n", rc);
+                }
+                else 
+                {
+                    rc = VbglR3GuestPropWriteValueF(g_uExecGuestPropSvcClientID, pszValueUtf8, "%d", rc);
+                    if (RT_FAILURE(rc))
+                        VBoxServiceError("Exec: Failed to write SysprepVBoxRC: rc=%Rrc\n", rc);
+                    RTStrFree(pszValueUtf8);
+                }
                 fSysprepDone = true;
             }
         }
-#endif /* temporarily disabled. */
-
 #ifdef FULL_FEATURED_EXEC
         1. Read the command - value, timestamp and flags.
