code: function findWindowsPortRange() {
    var deferredRange = promise.defer();
    // First, check if we're running on XP.  If this initial command fails,
    // we just fallback on the default IANA range.
    return execute('cmd.exe /c ver').then(function(stdout) {
      if (/Windows XP/.test(stdout)) {
        // TODO: Try to read these values from the registry.
        return {min: 1025, max: 5000};
      } else {
        return execute('netsh int ipv4 show dynamicport tcp').
            then(function(stdout) {
              /* > netsh int ipv4 show dynamicport tcp
                Protocol tcp Dynamic Port Range
                ---------------------------------
                Start Port : 49152
                Number of Ports : 16384
               */
              var range = stdout.split(/\n/).filter(function(line) {
                return /.*:\s*\d+/.test(line);
              }).map(function(line) {
                return Number(line.split(/:\s*/)[1]);
              });
  
              return {
                min: range[0],
                max: range[0] + range[1]
              };
            });
      }
    });
  }
docs: Computes the ephemeral port range for a Windows system.
  @return {!webdriver.promise.Promise.<{min: number, max: number}>} A promise
  that will resolve with the ephemeral port range on the current system.