Permanently removing Windows printers that keeps coming back

A simple change: a new Windows print server requiring a change in the printers installed using a Group Policy Targeting GPO (refer to this post from 2015 for more details).

Not so easy. Removing the old/existing printers were all but impossible. Nothing worked. Nothing. Others have had similar experiences; e.g. here, here, and here.

This is a two part post: 1) the actual removal script and 2) other online resources and discussion around the issue.

Removal Script

This script was used as GPO Computer shutdown script.

  1. Download: permanently_remove_printers_COMPUTER_shutdown_script.zip
  2. Edit the “shutdown_registry_printer_purge.bat” batch file. Go to Line 19 and 20 and change the server name in quotes for both lines. Two lines per printer.
    REM ------------------------------> Add these two lines per printer to remove and change server name <------------------------------
    
    rundll32 printui.dll,PrintUIEntry /gd /q /n"\\print\PaperCut"
    rundll32 printui.dll,PrintUIEntry /dn /q /n"\\print\PaperCut"
  3. Go to Line 23 and change the server name in quotes. One line per printer.
    REM ------------------------------> Add this one line per printer to remove and change server name <------------------------------
    
    ADPRINTX.exe /r "\\print\PaperCut"
  4. Edit the “printer_hive_cleanup.vbs” file. Go to Line 117 and 119 and change the server name in quotes for both lines. Two lines per printer.

    A special thanks to Mick for his wonderful vbs script. If you want a less forceful method, Mick also references a way to do per-user registry edit using Active-Setup (I did not test this method).
  5. Add the .bat file to a shutdown or startup script.
    The script must run as the SYSTEM user.

Other Resources on adding/removing Windows printers

  1. Removing a printer device FULLY – Microsoft Community 
  2. group policy – Deleted printers keeps coming back – and multiply – Server Fault 
  3. Problem with multiple instances of shared printers being installed on client computers when the spooler service is started 
  4. [SOLVED] All network printers automatically added for each user on 2012 R2 RDSH – Microsoft Remote Desktop Services – Spiceworks 
  5. Remove Printers by Name or Server – Script Center – Spiceworks 
  6. script to add new network printers 
  7. Set Default Printer if not in a specific group – Petri IT Knowledgebase Forums 
  8. Adding a network printer from the command line (or bat file) – Networking – Spiceworks 
  9. Script to remove obsolete printer in local profiles – Petri
  10. Hey, Scripting Guy! How Can I Remove All the Network Printers on a Computer?
  11. Printer mapping using GPP 
  12. Intermittent printer delivery failures with GPP – XenDesktop 7.x – Discussions 
  13. Logon Script Example Assign Printer – RUNDLL32 PRINTUI.DLL 
  14. scripting – Need to modify VB script so it deletes all existing network printers first – Server Fault 
  15. Adding and deleting printer drivers on Windows from INF files via command-line | Hajuria’s Blog 
  16. KB3170455 preventing printer installation 
  17. command line – Trying to use rundll32 printui.dll, PrintUIEntry to set up a printer, getting an error – Super User 

 

Search results aren’t quite ready yet, but we’re working on getting them together. Try back in a few minutes.

While I rely on Windows 10, this is classic example of reliability engineering.
Keep it simple.
Because of time constraints, posts will be short and to the point.

Cortana would not index files and as a result, Windows Search was effective non-functional. A clean reinstall with our current set of GPOs caused my domain account to crash Cortana. Even after excluding the suspect GPO, my user profile would still not allow Cortana to index files and Control Panel/Metro settings. The error was: “Search results aren’t quite ready yet, but we’re working on getting them together.  Try back in a few minutes.”

Google tells me many others are having the same issue: here, here, here here, here, and here if you want to read and learn more.
The fix? This assumes United States English. If you want a different language, copy/paste the files from the same location from a system with the identical language; e.g. en-GB

  1. Download: en-US
  2. Extract to:
    %USERPROFILE%\AppData\Local\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings
  3. If extracted correctly, double check the path:
  4. Reboot! Cortana and Window Search should be functional with complete results.

Another option is to remove the ability to search for Windows settings; refer to this thread.