diff --git a/includes/batch.inc b/includes/batch.inc
index 061acd4..0499a8c 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -435,10 +435,23 @@ function _batch_next_set() {
   if (isset($batch['sets'][$batch['current_set'] + 1])) {
     $batch['current_set']++;
     $current_set = &_batch_current_set();
-    if (isset($current_set['form_submit']) && ($function = $current_set['form_submit']) && function_exists($function)) {
-      // We use our stored copies of $form and $form_state to account for
-      // possible alterations by previous form submit handlers.
-      $function($batch['form_state']['complete form'], $batch['form_state']);
+    if (isset($current_set['form_submit']) && ($function = $current_set['form_submit'])) {
+      if (isset($batch['form_state']['build_info']['files')]) {
+        foreach ($batch['form_state']['build_info']['files'] as $file) {
+          if (is_array($file)) {
+            $file += array('type' => 'inc', 'name' => $file['module']);
+            module_load_include($file['type'], $file['module'], $file['name']);
+          }
+          elseif (file_exists($file)) {
+            require_once DRUPAL_ROOT . '/' . $file;
+          }
+        }
+      }
+      if (function_exists($function)) {
+        // We use our stored copies of $form and $form_state to account for
+        // possible alterations by previous form submit handlers.
+        $function($batch['form_state']['complete form'], $batch['form_state']);
+      }
     }
     return TRUE;
   }
