question

Mikexx-1940 avatar image
0 Votes"
Mikexx-1940 asked IanXue-MSFT commented

How to fully remove a printer using PowerShell or Command line

I can use:
remove-printer <name>
remove-printerdriver <name>

but in "Printers and scanners" list the printer remains with a note "Driver is unavailable".

This prevents a re-install of the printer driver (even with a reboot / pinter connected or not connected) and the only way to resolve the problem is to manually remove the printer from "Printers and scanners".

Hence the subject line.

I'm conscious this is a long standing bug as per:
https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/deleteprinter-not-working-properly-in-recent/59f9906e-c146-44ca-be8b-d88c5e716cee

But wondering if any progress has been made towards a solution.

windows-10-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

Have you tried the methods suggested by Monica Cam from your link? Does the printer still remain if you restart the spooler service and remove the registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers?

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Mikexx-1940 avatar image
0 Votes"
Mikexx-1940 answered IanXue-MSFT commented

Many thanks for your answer.

In an elevated Command prmpt I can run:
net stop spooler

With the response:
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.

However the printer persists in "Printers & scanners" with "Driver is unavilable".

I can restart the spooler service and the the printer persists in "Printers & scanners" with "Driver is unavilable".

After some further research:
If I wait a minute or so

Then I switch/connect the printer I get the same "progress bar" as if the driver was still available and the printer is being installed, except it pauses and gets 'stuck' at around 10% progress.

If I disconnect the printer, I lose the "Driver is unavalable tag".

I can wait as long as I want. If I touch the elevated Command Prompt the printer disappears it disappears from "Printers & scanners". What appears to be a coincidence is remarkably reliable but starangely connected behaviour.

After further research, using "remove-printerdriver" I get "remove-printerdriver : The specified driver is in use by one or more printers." and the only way forward is to manually remove the printer from "Printers & scanners".

This removal of printers still appears very buggy. Why there is a GUI means to remove printer but no command line method beats me!

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You can report the problem with the Feedback Hub App or through here https://windowsserver.uservoice.com/forums/301869-powershell

0 Votes 0 ·