diff --git a/includes/backend.inc b/includes/backend.inc
index f26743a..e9e4c16 100644
--- a/includes/backend.inc
+++ b/includes/backend.inc
@@ -302,8 +302,8 @@ function _drush_proc_open($cmd, $data = NULL, $context = NULL) {
  *   If the command could not be completed successfully, FALSE.
  *   If the command was completed, this will return an associative array containing the data from drush_backend_output().
  */
-function drush_backend_invoke_args($command, $args = array(), $data = array(), $method = 'GET', $integrate = TRUE, $drush_path = NULL, $hostname = NULL, $username = NULL, $ssh_options = NULL) {
-  $cmd = _drush_backend_generate_command($command, $args, $data, $method, $drush_path, $hostname, $username, $ssh_options);
+function drush_backend_invoke_args($command, $args = array(), $data = array(), $method = 'GET', $integrate = TRUE, $drush_path = NULL, $hostname = NULL, $username = NULL, $ssh_options = NULL, $os = NULL) {
+  $cmd = _drush_backend_generate_command($command, $args, $data, $method, $drush_path, $hostname, $username, $ssh_options, $os);
   return _drush_backend_invoke($cmd, $data, array_key_exists('#integrate', $data) ? $data['#integrate'] : $integrate);
 }
 
@@ -457,12 +457,13 @@ function _drush_backend_invoke($cmd, $data = null, $integrate = TRUE) {
  *
  * @deprecated Is not as flexible as recommended command.  @see _drush_backend_generate_command_sitealias().
  */
-function _drush_backend_generate_command($command, $args, &$data, $method = 'GET', $drush_path = null, $hostname = null, $username = null, $ssh_options = NULL) {
+function _drush_backend_generate_command($command, $args, &$data, $method = 'GET', $drush_path = null, $hostname = null, $username = null, $ssh_options = NULL, $os = NULL) {
   return _drush_backend_generate_command_sitealias(
     array(
       'remote-host' => $hostname,
       'remote-user' => $username,
       'ssh-options' => $ssh_options,
+      'os' => $os,
       'path-aliases' => array(
         '%drush-script' => $drush_path,
       ),
@@ -514,7 +515,8 @@ function _drush_backend_generate_command_sitealias($site_record, $command, $args
   $username = array_key_exists('remote-user', $site_record) ? $site_record['remote-user'] : null;
   $ssh_options = array_key_exists('ssh-options', $site_record) ? $site_record['ssh-options'] : null;
   $os = drush_os($site_record);
-
+drush_print_r($site_record);
+  drush_print('os is ' . $os);
   $drush_path = NULL;
   if (array_key_exists('path-aliases', $site_record)) {
     if (array_key_exists('%drush-script', $site_record['path-aliases'])) {
@@ -548,9 +550,15 @@ function _drush_backend_generate_command_sitealias($site_record, $command, $args
   }
   $cmd = $drush_command . " " . $option_str . " " . $command . (empty($data['#interactive']) ? " --backend" : "");
   if (!is_null($hostname)) {
-    $username = (!is_null($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : '';
-    $ssh_options = (!is_null($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
-    $cmd = "ssh " . $ssh_options . " " . $username . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd . ' 2>&1', "LOCAL") . ' 2>&1';
+    if (drush_is_windows($os)) {
+	  $username = (!is_null($username)) ? " -u:" . drush_escapeshellarg($username, "LOCAL") : '';
+      $cmd = "winrs" . $username . " -r:" . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd, "LOCAL");
+	}
+	else {
+	  $username = (!is_null($username)) ? drush_escapeshellarg($username, "LOCAL") . "@" : '';
+      $ssh_options = (!is_null($ssh_options)) ? $ssh_options : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
+      $cmd = "ssh " . $ssh_options . " " . $username . drush_escapeshellarg($hostname, "LOCAL") . " " . drush_escapeshellarg($cmd . ' 2>&1', "LOCAL") . ' 2>&1';
+    }
   }
   else {
     // TODO: `tty` is not usable on Windows.  Is this necessary at all, and if so, is there a better way to do it?
diff --git a/includes/drush.inc b/includes/drush.inc
index 6be7a31..c6ee9b4 100644
--- a/includes/drush.inc
+++ b/includes/drush.inc
@@ -753,7 +753,7 @@ function drush_remote_command() {
 
     // Force interactive mode if there is a single remote target.  #interactive is added by drush_do_command_redispatch
     drush_set_option('interactive', TRUE);
-    drush_do_command_redispatch($command, $args, $remote_host, $remote_user);
+    drush_do_command_redispatch($command, $args, $remote_host, $remote_user, NULL, drush_get_option('os'));
     return TRUE;
   }
   // If the --site-list flag is set, then we will execute the specified
@@ -901,7 +901,7 @@ function drush_do_site_command($site_record, $command, $args = array(), $data =
  * Redispatch the specified command using the same
  * options that were passed to this invocation of drush.
  */
-function drush_do_command_redispatch($command, $args = array(), $remote_host = NULL, $remote_user = NULL, $drush_path = NULL) {
+function drush_do_command_redispatch($command, $args = array(), $remote_host = NULL, $remote_user = NULL, $drush_path = NULL, $os = NULL) {
   $data = drush_redispatch_get_options();
 
   // The option allows ad hoc usage of #interactive.
@@ -922,7 +922,7 @@ function drush_do_command_redispatch($command, $args = array(), $remote_host = N
   }
   // Call through to backend invoke.
   drush_log(dt('Begin redispatch via backend invoke'));
-  $values = drush_backend_invoke_args($command, $args, $data, 'GET', TRUE, $drush_path, $remote_host, $remote_user);
+  $values = drush_backend_invoke_args($command, $args, $data, 'GET', TRUE, $drush_path, $remote_host, $remote_user, drush_get_option('ssh-options'), $os);
   drush_log(dt('Backend invoke is complete'));
 
   return $values;
