Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

setting default printer

$
0
0

I have this code:  

$printer= (Get-WMIObject-class Win32_Printer -computer'MyPCName'-Filter Default=True).name
$printer
Start-Sleep-s 10
$printer.SetDefaultPrinter()

I run this and it shows me my default printer.   During the 10 second pause I go into Control Panel and I change my default printer to something else.   The script then finishes yet my default printer does not change back.  How come? 

Also, the $Printer.SetDefaultPrinter()  variable I don't get.  I've seen a few examples of this on Google searches where people use this exact command to set a printer yet when I type in $printer. 'dot' the menu that pops up does not have a SetDefaultPrinter()     How come?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles