Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp	(revision 29841)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp	(revision 29842)
@@ -753,18 +753,4 @@
     int  rc = VINF_SUCCESS;
 #ifdef RT_OS_WINDOWS
-    /* Get the predefined path of sysprep.exe (depending on Windows OS). */
-    char szSysprepCmd[RTPATH_MAX] = "C:\\sysprep\\sysprep.exe";
-    OSVERSIONINFOEX OSInfoEx;
-    RT_ZERO(OSInfoEx);
-    OSInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
-    if (    GetVersionEx((LPOSVERSIONINFO) &OSInfoEx)
-        &&  OSInfoEx.dwPlatformId == VER_PLATFORM_WIN32_NT
-        &&  OSInfoEx.dwMajorVersion >= 6 /* Vista or later */)
-    {
-        rc = RTEnvGetEx(RTENV_DEFAULT, "windir", szSysprepCmd, sizeof(szSysprepCmd), NULL);
-        if (RT_SUCCESS(rc))
-            rc = RTPathAppend(szSysprepCmd, sizeof(szSysprepCmd), "system32\\sysprep\\sysprep.exe");
-    }
-
     /* 
      * If sysprep should be executed do this in the context of VBoxService, which
@@ -772,10 +758,22 @@
      * won't be shown (doesn't have a desktop).
      */
-    if (   RT_SUCCESS(rc) 
-        && stricmp(pszExec, szSysprepCmd) == 0)
-    {
-         rc = RTProcCreateEx(pszExec, papszArgs, hEnv, 0 /* fFlags */,
-                             phStdIn, phStdOut, phStdErr, NULL /* pszAsUser */,
-                             NULL /* pszPassword */, phProcess);
+    if (stricmp(pszExec, "sysprep") == 0)
+    {
+        /* Get the predefined path of sysprep.exe (depending on Windows OS). */
+        char szSysprepCmd[RTPATH_MAX] = "C:\\sysprep\\sysprep.exe";
+        OSVERSIONINFOEX OSInfoEx;
+        RT_ZERO(OSInfoEx);
+        OSInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+        if (    GetVersionEx((LPOSVERSIONINFO) &OSInfoEx)
+            &&  OSInfoEx.dwPlatformId == VER_PLATFORM_WIN32_NT
+            &&  OSInfoEx.dwMajorVersion >= 6 /* Vista or later */)
+        {
+            rc = RTEnvGetEx(RTENV_DEFAULT, "windir", szSysprepCmd, sizeof(szSysprepCmd), NULL);
+            if (RT_SUCCESS(rc))
+                rc = RTPathAppend(szSysprepCmd, sizeof(szSysprepCmd), "system32\\sysprep\\sysprep.exe");
+        }
+        rc = RTProcCreateEx(szSysprepCmd, papszArgs, hEnv, 0 /* fFlags */,
+                            phStdIn, phStdOut, phStdErr, NULL /* pszAsUser */,
+                            NULL /* pszPassword */, phProcess);
     }
     else
