Question Locked

vbscript set default printer

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

dear sir/mam
i have problem in setting a default printer in vb script coding this coding only run in vbscript editor but not working in IE browser.
because u give another idea to set default printer toprint i am using php and vbscript.
i want full program to another way.

2 replies

by ic-it

Change the \\server\printer to your actual server and printer.
Save it as a vbs file.

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\server\printer"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter "\\server\printer"

This discussion is closed to new replies.