How to rename a printer?  Download
This Delphi function renames a printer that is installed an a local or remote computer. It is designed for Windows XP or higher. This example utilizes TWmiMethod, TWmiQuery and TWmiConnection components. The source code below creates and destroys the components on the fly, so this function may be used in console- or UI-type applications.

// This function renames the specified printer. 
// It may be used for local or remote host. When used for local host 
// Destination, UserName and Password parameters must be empty. 
// For remote computer, parameters must be: 
// TargetHost: name or IP address of the remote host, like '10.8.36.54' 
// UserName: name of the user, may include domain, like 'MOON\Administrator'; 
// Password: the user's password. 
// OldName: the old name of the printer to be renamed 
//          ListPrinters function returns such names. 
//          See "How to list installed printers?" topic. 
// NewName: the new name for the printer. 
// The method returns empty string on success and error description otherwise 
function RenamePrinter(Destination, UserName, Password, OldName, NewName: string): string;
var
  Query: TWmiQuery;
  Connection: TWmiConnection;
  Method: TWmiMethod;
begin
  Query       := TWmiQuery.Create(nil);
  Connection  := TWmiConnection.Create(nil);
  Method      := TWmiMethod.Create(nil);
  try
    try
      Connection.MachineName := Destination;
      Connection.Credentials.UserName := UserName;
      Connection.Credentials.Password := Password;
      Connection.Connected := true;

      Query.WQL.Text   := 'select * from Win32_Printer';
      Query.Connection := Connection;
      Query.Open;
      Method.WmiObjectSource := Query;

      // find the printer by name 
      if not Query.Locate('Name', OldName, []) then
        raise Exception.Create('Printer not found: ' + OldName);

      // rename the printer 
      Method.WmiMethodName := 'RenamePrinter';
      Method.InParams.ParamByName('NewPrinterName').AsString := NewName;
      if Method.Execute <> 0 then
      begin
        Result := Method.LastWmiErrorDescription;
        if Result = '' then Result := 'Error ' + IntToStr(Method.LastWmiError);
      end;

    finally
      Method.Free;
      Query.Free;
      Connection.Free;
    end;
  except
    on E: Exception do Result := E.Message;
  end;
end;