DELPRINTER — Delete printers from the local machine.

Syntax:
DELPRINTER ​/K ​/N ​/Y name…

/Kfor locally controlled IP printers, also remove the port
/Nnot really; don’t actually delete printers
/Yanswer yes to all prompts
namethe name of the port to delete

This command deletes printers only from the system where it is run. If a network printer is specified, the connection will be removed from the local machine, but the printer will still exist on the server.

You must provide at least one name. Quote any name which contains spaces or other special characters.

You may specify one or more name parameters containing wildcards (inclusion masks), e.g. *CANON* to include printers whose names contain “Canon”. Any printer whose name matches any of the inclusion masks will be deleted. You can also specify wildcarded names to exclude; precede these with an exclamation point, e.g. !*OFFICE* to exclude all printers whose names contain the string “Office”. Exclusion masks override inclusion masks. Any printer whose name matches any exclusion mask will not be deleted, even if it matches one or more inclusion masks.

If a printer name matches a wildcard mask, DELPRINTER will prompt before deleting it. Use /Y to suppress the prompt. If the printer name is an exact match — character-for-character, not just a wildcard match — you will not be prompted.