Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 40683)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 40684)
@@ -401,19 +401,27 @@
 }
 
-static int ctrlPrintProgressError(ComPtr<IProgress> progress)
-{
-    int rc;
-    BOOL fCanceled;
-    if (   SUCCEEDED(progress->COMGETTER(Canceled(&fCanceled)))
-        && fCanceled)
-    {
-        rc = VERR_CANCELLED;
-    }
-    else
-    {
-        com::ProgressErrorInfo ErrInfo(progress);
-        rc = ctrlPrintError(ErrInfo);
-    }
-    return rc;
+static int ctrlPrintProgressError(ComPtr<IProgress> pProgress)
+{
+    int vrc = VINF_SUCCESS;
+    HRESULT rc;
+
+    do
+    {
+        BOOL fCanceled;
+        CHECK_ERROR_BREAK(pProgress, COMGETTER(Canceled)(&fCanceled));
+        if (!fCanceled)
+        {
+            LONG rcProc;
+            CHECK_ERROR_BREAK(pProgress, COMGETTER(ResultCode)(&rcProc));
+            if (FAILED(rcProc))
+                vrc = ctrlPrintError(com::ProgressErrorInfo(pProgress));
+        }
+
+    } while(0);
+
+    if (FAILED(rc))
+        AssertMsgStmt(NULL, ("Could not lookup progress information\n"), vrc = VERR_COM_UNEXPECTED);
+
+    return vrc;
 }
 
@@ -1111,6 +1119,6 @@
 
     bool fDirExists;
-    int rc = ctrlCopyDirExists(pContext, pContext->fHostToGuest, pszDir, &fDirExists);
-    if (   RT_SUCCESS(rc)
+    int vrc = ctrlCopyDirExists(pContext, pContext->fHostToGuest, pszDir, &fDirExists);
+    if (   RT_SUCCESS(vrc)
         && fDirExists)
     {
@@ -1120,4 +1128,9 @@
     }
 
+    /* If querying for a directory existence fails there's no point of even trying
+     * to create such a directory. */
+    if (RT_FAILURE(vrc))
+        return vrc;
+
     if (pContext->fVerbose)
         RTPrintf("Creating directory \"%s\" ...\n", pszDir);
@@ -1128,17 +1141,17 @@
     if (pContext->fHostToGuest) /* We want to create directories on the guest. */
     {
-        HRESULT hrc = pContext->pGuest->DirectoryCreate(Bstr(pszDir).raw(),
-                                                        Bstr(pContext->pszUsername).raw(), Bstr(pContext->pszPassword).raw(),
-                                                        0700, DirectoryCreateFlag_Parents);
-        if (FAILED(hrc))
-            rc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest));
+        HRESULT rc = pContext->pGuest->DirectoryCreate(Bstr(pszDir).raw(),
+                                                       Bstr(pContext->pszUsername).raw(), Bstr(pContext->pszPassword).raw(),
+                                                       0700, DirectoryCreateFlag_Parents);
+        if (FAILED(rc))
+            vrc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest));
     }
     else /* ... or on the host. */
     {
-        rc = RTDirCreateFullPath(pszDir, 0700);
-        if (rc == VERR_ALREADY_EXISTS)
-            rc = VINF_SUCCESS;
-    }
-    return rc;
+        vrc = RTDirCreateFullPath(pszDir, 0700);
+        if (vrc == VERR_ALREADY_EXISTS)
+            vrc = VINF_SUCCESS;
+    }
+    return vrc;
 }
 
@@ -1331,7 +1344,7 @@
         else
             rc = progress->WaitForCompletion(-1 /* No timeout */);
-        CHECK_PROGRESS_ERROR(progress, ("File copy failed"));
-        if (FAILED(rc))
-            vrc = ctrlPrintError(pContext->pGuest, COM_IIDOF(IGuest));
+        if (SUCCEEDED(rc))
+            CHECK_PROGRESS_ERROR(progress, ("File copy failed"));
+        vrc = ctrlPrintProgressError(progress);
     }
 
@@ -2268,6 +2281,7 @@
                 if (!fExists)
                 {
-                    RTPrintf("Cannot stat for element \"%s\": No such file or directory\n",
-                             it->first.c_str());
+                    if (fVerbose)
+                        RTPrintf("Cannot stat for element \"%s\": No such file or directory\n",
+                                 it->first.c_str());
                     rcExit = RTEXITCODE_FAILURE;
                 }
@@ -2368,9 +2382,9 @@
 
         HRESULT rc = S_OK;
-        ComPtr<IProgress> progress;
+        ComPtr<IProgress> pProgress;
         CHECK_ERROR(guest, UpdateGuestAdditions(Bstr(Utf8Source).raw(),
                                                 /* Wait for whole update process to complete. */
                                                 AdditionsUpdateFlag_None,
-                                                progress.asOutParam()));
+                                                pProgress.asOutParam()));
         if (FAILED(rc))
             vrc = ctrlPrintError(guest, COM_IIDOF(IGuest));
@@ -2378,12 +2392,13 @@
         {
             if (fVerbose)
-                rc = showProgress(progress);
+                rc = showProgress(pProgress);
             else
-                rc = progress->WaitForCompletion(-1 /* No timeout */);
-            CHECK_PROGRESS_ERROR(progress, ("Guest additions update failed"));
-            if (FAILED(rc))
-                vrc = ctrlPrintError(guest, COM_IIDOF(IGuest));
-            else if (   SUCCEEDED(rc)
-                     && fVerbose)
+                rc = pProgress->WaitForCompletion(-1 /* No timeout */);
+
+            if (SUCCEEDED(rc))
+                CHECK_PROGRESS_ERROR(pProgress, ("Guest additions update failed"));
+            vrc = ctrlPrintProgressError(pProgress);
+            if (   RT_SUCCESS(vrc)
+                && fVerbose)
             {
                 RTPrintf("Guest Additions update successful\n");
