Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 55629)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 55630)
@@ -1091,35 +1091,42 @@
         for (int i = argc - cNonOptions; i < argc; ++i)
         {
-            /* I'm sure this isn't the most effective way, but I hope it will
-             * be readable and reliable code. */
-            if (RTDirExists(argv[i]) && !RTSymlinkExists(argv[i]))
+            RTFSOBJINFO Info;
+            int rc2 = RTPathQueryInfoEx(argv[i], &Info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
+            if (RT_SUCCESS(rc))
             {
-                if (!(fFlags & VBOXSERVICETOOLBOXRMFLAG_RECURSIVE))
-                    toolboxRmReport("Cannot remove directory '%s' as the '-R' option was not specified.\n",
-                                    argv[i], true, VERR_INVALID_PARAMETER,
-                                    fOutputFlags, &rc);
+                if (RTFS_IS_SYMLINK(Info.Attr.fMode))
+                {
+                    rc2 = RTSymlinkDelete(argv[i], 0 /*fFlags*/);
+                    toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
+                    toolboxRmReport("The following error occurred while removing symlink '%s': %Rrc.\n",
+                                    argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
+                }
+                else if (RTFS_IS_DIRECTORY(Info.Attr.fMode))
+                {
+                    if (!(fFlags & VBOXSERVICETOOLBOXRMFLAG_RECURSIVE))
+                        toolboxRmReport("Cannot remove directory '%s' as the '-R' option was not specified.\n",
+                                        argv[i], true, VERR_INVALID_PARAMETER, fOutputFlags, &rc);
+                    else
+                    {
+                        rc2 = RTDirRemoveRecursive(argv[i], RTDIRRMREC_F_CONTENT_AND_DIR);
+                        toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
+                        toolboxRmReport("The following error occurred while removing directory '%s': %Rrc.\n",
+                                        argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
+                    }
+                }
                 else
                 {
-                    int rc2 = RTDirRemoveRecursive(argv[i],
-                                                   RTDIRRMREC_F_CONTENT_AND_DIR);
-                    toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2,
-                                    fOutputFlags, NULL);
-                    toolboxRmReport("The following error occurred while removing directory '%s': %Rrc.\n",
-                                    argv[i], RT_FAILURE(rc2), rc2,
-                                    fOutputFlags, &rc);
+                    rc2 = RTFileDelete(argv[i]);
+                    toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
+                    toolboxRmReport("The following error occurred while removing file '%s': %Rrc.\n",
+                                    argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
                 }
             }
-            else if (RTPathExists(argv[i]) || RTSymlinkExists(argv[i]))
-            {
-                int rc2 = RTFileDelete(argv[i]);
-                toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2,
-                                fOutputFlags, NULL);
-                toolboxRmReport("The following error occurred while removing file '%s': %Rrc.\n",
-                                argv[i], RT_FAILURE(rc2), rc2, fOutputFlags,
-                                &rc);
-            }
+            else if (   rc2 == VERR_FILE_NOT_FOUND
+                     || rc2 == VERR_PATH_NOT_FOUND)
+                toolboxRmReport("File '%s' does not exist (%Rrc).\n", argv[i], true, rc2, fOutputFlags, &rc);
             else
-                toolboxRmReport("File '%s' does not exist.\n", argv[i],
-                                true, VERR_FILE_NOT_FOUND, fOutputFlags, &rc);
+                toolboxRmReport("The following error occurred while checkin '%s' before removal: %Rrc.\n",
+                                argv[i], true, rc2, fOutputFlags, &rc);
         }
 
