diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 429b28b..3d3f97a 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -262,6 +262,12 @@ function simpletest_script_init($server_software) {
     // Extract only the PHP interpreter, not the rest of the command.
     list($php, ) = explode(' ', $_ENV['SUDO_COMMAND'], 2);
   }
+  //Windows
+  elseif (!empty($_SERVER['PHPRC'])) {
+    if (is_dir($_SERVER['PHPRC']) && file_exists($_SERVER['PHPRC'] . DIRECTORY_SEPARATOR . 'php.exe')) {
+      $php = $_SERVER['PHPRC'] . DIRECTORY_SEPARATOR . 'php.exe';
+    }
+  }
   else {
     simpletest_script_print_error('Unable to automatically determine the path to the PHP interpreter. Supply the --php command line argument.');
     simpletest_script_help();
