[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB Scripting - Printers / Netowrk objects

Posted on 2004-10-28
2
Medium Priority
?
187 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:BrianBaley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 375 total points
ID: 12445394
Try using net.AddWindowsPrinterConnection "\\mydomain\printername"

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

J.
0
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12626352
I believe you can also use \\aaa.bbb.ccc.ddd (the printer IP) as a UNC, if it is fixed, too.

J.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question