VB Scripting - Printers / Netowrk objects

I need some help with a VB Script (used for Terminal Services users)

I've done scripts like this;

dim met
set net=CreateObject(WScript.Network")
net.AddWindowsPrinterConnection "\\server\printer", "PName"

- and -

net.SetDefaultPrinter "\\server\printer"

but what if the printer is not a shared device ?  e.g. - an network printer with a NIC (IP Port on client) ?
how do you specify this printer using "net.SetDefaultPrinter" ?

couldnt find specific info on this.
LVL 1
BrianBaleyAsked:
Who is Participating?
 
jimbobmcgeeConnect With a Mentor Commented:
Try using net.AddWindowsPrinterConnection "\\mydomain\printername"

Most networked printers are installed with a machine name...

J.
0
 
jimbobmcgeeCommented:
I believe you can also use \\aaa.bbb.ccc.ddd (the printer IP) as a UNC, if it is fixed, too.

J.
0
All Courses

From novice to tech pro — start learning today.