Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -169,5 +169,6 @@
     const size_t NoJobs = mpqccontroller.addJobsFromQueue(
         params.DoLongrange.get() ? MPQCData::DoSampleDensity : MPQCData::DontSampleDensity,
-        params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly
+        params.DoValenceOnly.get() ? MPQCData::DoSampleValenceOnly : MPQCData::DontSampleValenceOnly,
+        params.executable.get().string()
         );
     LOG(1, "INFO: Added " << NoJobs << " from FragmentJobsQueue.");
Index: src/Fragmentation/Automation/MPQCCommandFragmentController.cpp
===================================================================
--- src/Fragmentation/Automation/MPQCCommandFragmentController.cpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Fragmentation/Automation/MPQCCommandFragmentController.cpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -61,5 +61,6 @@
 bool MPQCCommandFragmentController::addJobsFromQueue(
     const MPQCData::DoLongrange_t _DoLongrange,
-    const MPQCData::DoValenceOnly_t _DoValenceOnly
+    const MPQCData::DoValenceOnly_t _DoValenceOnly,
+    const std::string &_executable
     )
 {
@@ -74,4 +75,7 @@
 #ifndef HAVE_JOBMARKET
     job->setId(getAvailableId());
+    if (!_executable.empty())
+      job->setCommand(_executable);
+    job->setSuffix(".in");
 #endif /* cause we don't inherit from FragmentController */
     // add the jobs
Index: src/Fragmentation/Automation/MPQCCommandFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/MPQCCommandFragmentController.hpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Fragmentation/Automation/MPQCCommandFragmentController.hpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -44,9 +44,11 @@
    * \param _DoSampleDensity whether to actually sample the resulting electronic density
    * \param _DoValenceOnly whether to sample just the valence or the total elctron and nuclei density
+   * \param _command command to pass to jobs for execution
    * \return true - jobs obtained, false - queue empty
    */
   bool addJobsFromQueue(
       const MPQCData::DoLongrange_t _DoLongrange,
-      const MPQCData::DoValenceOnly_t _DoValenceOnly
+      const MPQCData::DoValenceOnly_t _DoValenceOnly,
+      const std::string &_command
       );
 
Index: src/Jobs/JobMarket/SystemCommandJob.cpp
===================================================================
--- src/Jobs/JobMarket/SystemCommandJob.cpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Jobs/JobMarket/SystemCommandJob.cpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -77,8 +77,14 @@
  * \param _outputfile configuration file for solver
  * \param _JobId unique id of this job
- */
-SystemCommandJob::SystemCommandJob(const std::string &_command, const std::string &_outputfile, const JobId_t _JobId) :
+ * \param _suffix possible suffix for temporary filenames, may be left empty
+ */
+SystemCommandJob::SystemCommandJob(
+    const std::string &_command, 
+    const std::string &_outputfile, 
+    const JobId_t _JobId,
+    const std::string &_suffix) :
   FragmentJob(_JobId),
   command(_command),
+  suffix(_suffix),
   outputfile(_outputfile)
 {}
@@ -121,4 +127,5 @@
     "SystemCommandJob::Work() - the temporary file could not be opened.");
   output << outputfile << std::endl;
+  output.close();
 
   // fork into subprocess and launch command
@@ -163,5 +170,4 @@
 
   // close temporary file and remove it
-  output.close();
   boost::filesystem::path tmpPath(tmpTemplate);
   if (boost::filesystem::exists(boost::filesystem::status(tmpPath))) {
Index: src/Jobs/JobMarket/SystemCommandJob.hpp
===================================================================
--- src/Jobs/JobMarket/SystemCommandJob.hpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Jobs/JobMarket/SystemCommandJob.hpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -42,5 +42,5 @@
   friend class SystemCommandJobTest;
 public:
-  SystemCommandJob(const std::string &_command, const std::string &_outputfile, const JobId_t _JobId);
+  SystemCommandJob(const std::string &_command, const std::string &_outputfile, const JobId_t _JobId, const std::string &_suffix = std::string(""));
   virtual ~SystemCommandJob();
 
@@ -53,9 +53,20 @@
   }
 
-private:
+  const std::string& getOutputfile() const {
+    return outputfile;
+  }
+
+  const std::string& getCommand() const {
+    return command;
+  }
+
+protected:
   virtual FragmentResult::ptr extractResult(const std::string &resultstring);
 
   //!> string containing the command to launch the solver
   std::string command;
+
+  //!> suffix to be appended to output file name
+  std::string suffix;
 
   //!> string containing the configuration file for the solver
Index: src/Jobs/MPQCCommandJob.hpp
===================================================================
--- src/Jobs/MPQCCommandJob.hpp	(revision 18ed8c7a1d88e9db52b1b57a548546f17406a526)
+++ src/Jobs/MPQCCommandJob.hpp	(revision d6a7b9066f589c9d821d442a8d23585ebd632c24)
@@ -29,4 +29,5 @@
 
 class MPQCCommandJobTest;
+class MPQCCommandFragmentController;
 
 /** This class calls mpqc for solving a specific Hartree Fock problem.
@@ -37,4 +38,6 @@
   //!> grant unit test access
   friend class MPQCCommandJobTest;
+  //!> grant access to controller
+  friend class MPQCCommandFragmentController;
 public:
   MPQCCommandJob(const std::string &_inputfile, const JobId_t _JobId, const std::string &_command = std::string("mpqc"));
@@ -48,4 +51,12 @@
 
 private:
+  //!> Allow controller access to changing the commands
+  void setCommand(const std::string &_command)
+  { command = _command; }
+
+  //!> Allow controller access to changing the suffix
+  void setSuffix(const std::string &_suffix)
+  { suffix = _suffix; }
+
   //!> private default cstor only for serializatio
   MPQCCommandJob();
