Index: scripts/run-tests.sh
===================================================================
RCS file: /cvs/drupal/drupal/scripts/run-tests.sh,v
retrieving revision 1.15
diff -u -p -r1.15 run-tests.sh
--- scripts/run-tests.sh	29 Oct 2008 03:00:38 -0000	1.15
+++ scripts/run-tests.sh	7 Nov 2008 23:26:10 -0000
@@ -241,7 +241,14 @@ function simpletest_script_init() {
     // Extract only the PHP interpreter, not the rest of the command.
     list($php, ) = explode(' ', $_ENV['SUDO_COMMAND'], 2);
   }
-  else {
+  elseif (!empty($_SERVER['OS']) && strpos($_SERVER['OS'], 'Win') !== FALSE && !empty($_SERVER['Path']) && stripos($_SERVER['Path'], 'php') !== FALSE) {
+    // Extract the PHP interpreter from the Path server variable.
+    preg_match('@;?([^;]+php[^;]*)@i', $_SERVER['Path'], $matches);
+    if (!empty($matches[1]) && file_exists($matches[1] . '/php.exe')) {
+      $php = $matches[1] . '/php.exe';
+    }
+  }
+  if (empty($php)) {
     simpletest_script_print_error('Unable to automatically determine the path to the PHP interpreter. Please supply the --php command line argument.');
     exit();
   }
