--- backup.module	2007-03-16 00:42:24.000000000 -0400
+++ backup.module.new	2008-02-25 17:44:32.046875000 -0500
@@ -220,7 +220,15 @@ function backup_search_path($file) {
 	$retval = '';
 
 	$path = getenv('PATH');
-	$path = explode(':', $path);
+
+	if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { // for Windows
+		$path = explode(';', $path);
+	} else { // for the rest of us
+		$path = explode(':', $path);
+	}
+
+
+
 
 	foreach ($path as $key => $value) {
 		$file2 = $value . '/' . $file;
@@ -257,7 +265,16 @@ function backup_get_programs() {
 		"gzip",
 		//"TEST2"
 		);
-
+	
+	// If we're on Windows, add ".exe" to the filenames
+	if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+		$winbinaries = array();
+		foreach($binaries as $bin) {
+			$winbinaries[] = $bin . ".exe";
+		}
+		$binaries = $winbinaries;
+	}
+	
 	//
 	// Loop through our programs and search for each
 	//
@@ -340,7 +357,11 @@ function backup_get_path() {
 	//
 	// Add in spaces so that the text will wrap.
 	//
-	$path = str_replace(':', ': ', $path);
+	if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { // for Windows
+		$path = str_replace(';', '; ', $path);
+	} else {
+		$path = str_replace(':', ': ', $path);
+	}
 
 	$retval = $path;
 
