Index: other-projects/nightly-tasks/diffcol/trunk/task.pl
===================================================================
--- other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 27667)
+++ other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 27668)
@@ -38,9 +38,10 @@
 # TASK_HOME should be the toplevel diffcol folder
 $ENV{'TASK_HOME'} = getcwd unless defined $ENV{'TASK_HOME'};
+$ENV{'TASK_HOME'} =~ s@\/@\\@g if $isWin;
 ##    print STDERR "@@@ TASK_HOME: ".$ENV{'TASK_HOME'}."\n";
 
 
-$ENV{'DATA_DIR'} = filename_concat($ENV{'TASK_HOME'}, "diffcol-data");
-$ENV{'UPLOAD_DIR'} = filename_concat($ENV{'TASK_HOME'}, "diffcol-reports");
+$ENV{'DATA_DIR'} = &filename_concat($ENV{'TASK_HOME'}, "diffcol-data");
+$ENV{'UPLOAD_DIR'} = &filename_concat($ENV{'TASK_HOME'}, "diffcol-reports");
 $ENV{'MONITOR_EMAIL'} = "greenstone_team\@cs.waikato.ac.nz"; # need to escape @ sign
 $ENV{'GSDL_SMTP'} = "";
@@ -115,4 +116,5 @@
 my @files = <$jar_lib_path/*.jar>; # /full/path/to/diffcol/lib/*jar
 foreach my $file (@files) {
+	$file =~ s@\/@\\@g if $isWin;
     $ENV{'CLASSPATH'}=$file.$pathsep.$ENV{'CLASSPATH'};
 }
@@ -169,5 +171,4 @@
     print STDERR "Run as: $0 (help|setup_greenstone|run_test|summarise|upload|all)\n";
 }
-
 
 #http://stackoverflow.com/questions/7427262/read-a-file-and-save-it-in-variable-using-shell-script
@@ -208,4 +209,8 @@
     # http://stackoverflow.com/questions/758611/how-to-flush-output-in-backticks-in-perl?rq=1
     my $status = system "$cmd"; #my $status = `$cmd`;
+	if($status != 0) {
+		print STDERR "@@@ SVN checkout of $gsdl failed\n";
+		exit -1;
+	}	
     print STDERR "done\n";
 
@@ -216,7 +221,14 @@
     ##print STDERR "@@@ OS:  $^O.|".$Config{'archname64'}."|\n";
 
-    # if we're on linux/darwin, need gnome-lib for the correct architecture.
-    if(!$isWin) {
-
+    
+    if($isWin) {
+		print STDERR "Compiling $gsdl using makegs2.bat running in auto (silent) mode\n";
+	
+		# we're now in the GS2 folder, call makegs2 with silent param
+		$cmd = "makegs2.bat silent 2>> $ENV{'DATA_DIR'}/compilation-errors"; # STDERR is sent to compilation-errors file
+		$status = system $cmd;
+		
+	} else { # if we're on linux/darwin, need gnome-lib for the correct architecture.
+	
 	print STDERR "setting up gnome-lib-minimal for compilation\n";
 
@@ -282,7 +294,12 @@
 	
 	$cmd .= "\""; # close off cmd to bash and run it
-	system $cmd;	
-    }
-
+	$status = system $cmd;
+    }
+	
+	if($status != 0) {
+		print STDERR "@@@ Compile failed\n";
+		exit -1;
+	}
+	
     # set the path to the greenstone_home variable                             
     $greenstone_home="$ENV{'DATA_DIR'}$sep$gsdl";
@@ -293,5 +310,5 @@
 sub run_test
 {
-    open (my $xml_fh, '>'.$xmlout) || die "Could not open xml file $xmlout for appending: $!\n";   
+    open (my $xml_fh, '>'.$xmlout) || die "Could not open xml file $xmlout for appending: $!\n";
 
     # perform the requested subcommands, outputting xml information
@@ -309,5 +326,5 @@
     print STDERR "getting svn info: $xmlout\n";
     print $xml_fh "<svn-info>\n";
-    run_and_print_cmd("svn info", $xml_fh);
+    &run_and_print_cmd("svn info", $xml_fh);
     print $xml_fh "</svn-info>\n";
     print STDERR "done\n";
@@ -405,5 +422,6 @@
 
     } else { # Need to prefix cmd -c/-k as necessary
-	$cmd = "cd $greenstone_home && set GSDLHOME=&& source $setup_script.bat && cd $diffcol_dir && $cmd";
+	$cmd = "cmd /c \"set GSDLHOME=&& $setup_script.bat && cd $diffcol_dir && perl -S $cmd\"";
+##	print STDERR "@@@@ Going to call command: $cmd\n";	
     }
 
@@ -422,8 +440,10 @@
 
     } else { # Need to prefix cmd -c/-k as necessary
-	$cmd = "set GSDLHOME=&& source $setup_script.bat && $cmd";
-    }
-
-    return system($cmd); 
+	$cmd = "cmd /c \"set GSDLHOME=&& $setup_script.bat && perl -S $cmd\"";
+##	print STDERR "@@@@ Going to call command: $cmd\n";
+	
+    }
+
+    return system($cmd);
     #return &run_and_print_cmd($cmd, $fh); # doesn't work on cmds chained with bash -c
 }
@@ -630,2 +650,3 @@
   ##system("/bin/bash -c \"./task @ARGV\"");
   ##print STDERR "/bin/bash -c ../etc/tasks/diffcol/task @ARGV"
+  
