Set a default printer from VB script

Create a .vbs file (name it DefaultPrinterChanger.vbs or something else) and change the default printer name to the name of the default printer you need.

Set WSHNetwork = CreateObject("WScript.Network")
WSHNetwork.SetDefaultPrinter "HP Printer"

You can also call this script from a batch script; for example:

@ECHO OFF
TITLE Change default printer
Cscript C:\voorbeeld\DefaultPrinterChanger.vbs

 

Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.

 

2 thoughts on “Set a default printer from VB script

  1. Oh my goodness! Incredible article dude!
    Thank you, However I am going through difficulties with your RSS.

    I don’t know the reason why I can’t join it. Is there anyone else
    having the same RSS issues? Anyone that knows the answer can you kindly
    respond? Thanx!!

  2. Pingback: Windows: Standard-Drucker per Befehl oder Skript setzen – Andy's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *