diff --git a/Code/Mantid/Kernel/src/ConfigService.cpp b/Code/Mantid/Kernel/src/ConfigService.cpp
index ad05e1f7913b6754466e116c4b1ebc600f4b45ea..a891b8003a5add3c7c02fef2137a0f75480fcac5 100644
--- a/Code/Mantid/Kernel/src/ConfigService.cpp
+++ b/Code/Mantid/Kernel/src/ConfigService.cpp
@@ -21,6 +21,7 @@
 #include "Poco/DOM/Element.h"
 #include "Poco/DOM/NodeList.h"
 #include "Poco/Notification.h"
+#include "Poco/Environment.h"
 
 #include <fstream>
 #include <sstream>
@@ -139,7 +140,10 @@ ConfigServiceImpl::ConfigServiceImpl() :
   if (callingApplication.find("python") != std::string::npos || callingApplication.find("matlab")
       != std::string::npos)
   {
-    m_strBaseDir = Poco::Path::current();
+    if (Poco::Environment::has("MANTIDPATH"))
+       m_strBaseDir = Poco::Environment::get("MANTIDPATH");
+    else
+      m_strBaseDir = Poco::Path::current();
   }
   else
   {