Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 66067)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 66068)
@@ -1025,4 +1025,6 @@
         RTStrmPrintf(pStrm,
                            "%s unattended %s      <uuid|vmname>\n"
+                     "                            usefile --file <file>\n"
+                     "                            usedata\n"
                      "                            --user <username>\n"
                      "                            --password <password>\n"
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 66067)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 66068)
@@ -1237,5 +1237,7 @@
     { "-addisopath",      'a', RTGETOPT_REQ_STRING },
     { "-imageindex",      'm', RTGETOPT_REQ_UINT16 },
-    { "--imageindex",      'm', RTGETOPT_REQ_UINT16 },
+    { "--imageindex",     'm', RTGETOPT_REQ_UINT16 },
+    { "-settingfile",     's', RTGETOPT_REQ_STRING },
+    { "--settingfile",    's', RTGETOPT_REQ_STRING },
 };
 
@@ -1252,4 +1254,5 @@
     Bstr machineName;
     BOOL bInstallGuestAdditions;
+    Bstr fileWithSettings;
     unsigned short imageIndex = 1;//applied only to Windows installation
 
@@ -1258,44 +1261,67 @@
     RTGETOPTSTATE GetState;
 
-    // start at 0 because main() has hacked both the argc and argv given to us
+    // start at 2(third) argument because 0(first) is <uuid\vmname>, 1(second) is <usedata\usefile>
     RTGetOptInit(&GetState, a->argc, a->argv, g_aUnattendedInstallOptions, RT_ELEMENTS(g_aUnattendedInstallOptions),
-                 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
-    while ((c = RTGetOpt(&GetState, &ValueUnion)))
-    {
-        switch (c)
-        {
-            case 'u':   // --user
-                user = ValueUnion.psz;
-                break;
-
-            case 'p':   // --password
-                password = ValueUnion.psz;
-                break;
-
-            case 'k':   // --key
-                productKey = ValueUnion.psz;
-                break;
-
-            case 'a':   // --addisopath
-                vboxAdditionsIsoPath = ValueUnion.psz;
-                break;
-
-            case 'i':   // --isopath
-                isoPath = ValueUnion.psz;
-                break;
-            case 'm':   // --image index
-                imageIndex = ValueUnion.u8;
-                break;
-            default:
-                return errorGetOpt(USAGE_UNATTENDEDINSTALL, c, &ValueUnion);
-        }
-    }
-
-    /* check for required options */
-    if (user.isEmpty() ||
-        password.isEmpty() ||
-        isoPath.isEmpty()
-        )
-        return errorSyntax(USAGE_UNATTENDEDINSTALL, "One of needed parameters has been missed");
+                 2, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
+
+    if (!strcmp(a->argv[1], "usefile"))
+    {
+        while ((c = RTGetOpt(&GetState, &ValueUnion)))
+        {
+            switch (c)
+            {
+                case 's':   // --a file with data prepared by user
+                    fileWithSettings = ValueUnion.psz;
+                    break;
+                default:
+                    return errorGetOpt(USAGE_UNATTENDEDINSTALL, c, &ValueUnion);
+            }
+        }
+
+        /* check for required options */
+        if (fileWithSettings.isEmpty())
+            return errorSyntax(USAGE_UNATTENDEDINSTALL, "One of needed parameters has been missed");
+    }
+    else if(!strcmp(a->argv[1], "usedata"))
+    {
+        while ((c = RTGetOpt(&GetState, &ValueUnion)))
+        {
+            switch (c)
+            {
+                case 'u':   // --user
+                    user = ValueUnion.psz;
+                    break;
+
+                case 'p':   // --password
+                    password = ValueUnion.psz;
+                    break;
+
+                case 'k':   // --key
+                    productKey = ValueUnion.psz;
+                    break;
+
+                case 'a':   // --addisopath
+                    vboxAdditionsIsoPath = ValueUnion.psz;
+                    break;
+
+                case 'i':   // --isopath
+                    isoPath = ValueUnion.psz;
+                    break;
+                case 'm':   // --image index
+                    imageIndex = ValueUnion.u8;
+                    break;
+                default:
+                    return errorGetOpt(USAGE_UNATTENDEDINSTALL, c, &ValueUnion);
+            }
+        }
+
+        /* check for required options */
+        if (user.isEmpty() || password.isEmpty() || isoPath.isEmpty())
+            return errorSyntax(USAGE_UNATTENDEDINSTALL, "One of needed parameters has been missed");
+    }
+    else
+    {
+        return errorSyntax(USAGE_UNATTENDEDINSTALL, "Unknown subcommand. Must be \"usefile\" or \"usedata\" ");
+    }
 
     /* try to find the given machine */
@@ -1336,33 +1362,44 @@
         CHECK_ERROR_BREAK(machine, COMGETTER(Unattended)(unAttended.asOutParam()));
 
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(Group)(group.raw()));
-
-        if (installedOSStr.contains("Windows") && productKey.isEmpty())
-        {
-            return errorSyntax(USAGE_UNATTENDEDINSTALL, "Product key has been missed.");
-        }
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(VboxAdditionsIsoPath)(vboxAdditionsIsoPath.raw()));
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(IsoPath)(isoPath.raw()));
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(User)(user.raw()));
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(Password)(password.raw()));
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(ProductKey)(productKey.raw()));
-
-        bool fInstallGuestAdditions = (vboxAdditionsIsoPath.isEmpty()) ? false: true;
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(InstallGuestAdditions)(fInstallGuestAdditions));
-
-        CHECK_ERROR_BREAK(unAttended, COMSETTER(ImageIndex)(imageIndex));
-
-        CHECK_ERROR_BREAK(unAttended,Preparation());
-        CHECK_ERROR_BREAK(unAttended,ConstructScript());
-        CHECK_ERROR_BREAK(unAttended,ConstructMedia());
-        CHECK_ERROR_BREAK(unAttended,ReconstructVM());
-        CHECK_ERROR_BREAK(unAttended,RunInstallation());
+        if (fileWithSettings.isEmpty())//may use also this condition (!strcmp(a->argv[1], "usedata"))
+        {
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(Group)(group.raw()));
+
+            if (installedOSStr.contains("Windows") && productKey.isEmpty())
+            {
+                return errorSyntax(USAGE_UNATTENDEDINSTALL, "Product key has been missed.");
+            }
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(VboxAdditionsIsoPath)(vboxAdditionsIsoPath.raw()));
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(IsoPath)(isoPath.raw()));
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(User)(user.raw()));
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(Password)(password.raw()));
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(ProductKey)(productKey.raw()));
+
+            bool fInstallGuestAdditions = (vboxAdditionsIsoPath.isEmpty()) ? false: true;
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(InstallGuestAdditions)(fInstallGuestAdditions));
+
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(ImageIndex)(imageIndex));
+            CHECK_ERROR_BREAK(unAttended,Preparation());
+            CHECK_ERROR_BREAK(unAttended,ConstructScript());
+            CHECK_ERROR_BREAK(unAttended,ConstructMedia());
+            CHECK_ERROR_BREAK(unAttended,ReconstructVM());
+            CHECK_ERROR_BREAK(unAttended,RunInstallation());
+
+        }
+        else
+        {
+            CHECK_ERROR_BREAK(unAttended, COMSETTER(FileWithPreparedData)(fileWithSettings.raw()));
+            CHECK_ERROR_BREAK(unAttended,Preparation());
+            CHECK_ERROR_BREAK(unAttended,ReconstructVM());
+            CHECK_ERROR_BREAK(unAttended,RunInstallation());
+        }
+
         a->session->UnlockMachine();
-//  CHECK_ERROR_RET(sessionMachine, UnlockMachine(), RTEXITCODE_FAILURE);
+
         {
             Bstr env;
@@ -1421,5 +1458,7 @@
         bInstallGuestAdditions = false;
         imageIndex = 0;
-
+        fileWithSettings.setNull();
+
+        CHECK_ERROR_BREAK(unAttended, COMGETTER(FileWithPreparedData)(fileWithSettings.asOutParam()));
         CHECK_ERROR_BREAK(unAttended, COMGETTER(Group)(group.asOutParam()));
         CHECK_ERROR_BREAK(unAttended, COMGETTER(VboxAdditionsIsoPath)(vboxAdditionsIsoPath.asOutParam()));
@@ -1429,6 +1468,7 @@
         CHECK_ERROR_BREAK(unAttended, COMGETTER(ProductKey)(productKey.asOutParam()));
         CHECK_ERROR_BREAK(unAttended, COMGETTER(ImageIndex)(&imageIndex));
-        RTPrintf("Got values:\n user: %s\n password: %s\n productKey: %s\n image index: %d\n "
+        RTPrintf("Got values:\n fileWithSettings: %s\n user: %s\n password: %s\n productKey: %s\n image index: %d\n "
                  "isoPath: %s\n vboxAdditionsIsoPath: %s\n",
+                 Utf8Str(fileWithSettings).c_str(),
                  Utf8Str(user).c_str(),
                  Utf8Str(password).c_str(),
