code: function buildRdpFile(config) {
    var deferred = Q.defer();
    var fileContent = getRdpFileContent(config);
    var fileName = path.normalize(os.tmpdir() + '/' + sanitize(config.address) + '.rdp');
    Q.nfcall(fs.writeFile, fileName, fileContent)
      .then(function() {
        deferred.resolve(fileName);
      })
      .fail(deferred.reject);
    return deferred.promise;
  }
docs: Returns a promise that will be resolved as soon as the file is created.
  @param config
  @returns {promise|*|Q.promise}