Set the Default Printer from PowerShell

Point Windows' default printer at the device you actually use, via the WScript.Network COM object.

WindowsprintingprinterspowershellLow risk
Run (New-Object -ComObject WScript.Network).SetDefaultPrinter("Printer Name") with the exact name shown by Get-Printer.

01Command

Command
$ (New-Object -ComObject WScript.Network).SetDefaultPrinter("HP LaserJet 1020")

02What it does

When a shared office printer or an old PDF tool steals the default slot, every print dialog opens on the wrong device. The WshNetwork COM object has exposed SetDefaultPrinter since the XP era and still works in Windows 11, making it a reliable one-liner for scripts and login tasks. The name must match the printer's displayed name exactly — run Get-Printer to copy it. Note that Windows' "let Windows manage my default printer" setting will override this the next time you print somewhere else, so turn that off in Settings > Bluetooth & devices > Printers if you want the choice to stick.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions