Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS to install a printer in my LAN

Status
Not open for further replies.

guif

Programmer
Sep 6, 2007
27
0
0
ES
Hi!
my English is very poor... sorry!
I would like to make this:

In my work I install the printers when I go to START->RUN and write: \\SERVER01\PRINTER01 and I'm use a Remote program.

but...I would like to make this with my PC.

one idea is:

Option explicit
Dim PC, PRINTER
PC=inputbox("In wich PC did you want to install?")
impresora=inputbox("What printer do you like to install?")

Is it possible???
 
on Microsoft's Site, I found


Install a Printer

Description

Installs a logical network printer on a print server.

Supported Platforms

Windows Server 2003


Yes

Windows XP


Yes

Windows 2000


No

Windows NT 4.0


No

Windows 98


No

Script Code

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_

objPrinter.DriverName = "HP LaserJet 4000 Series PS"
objPrinter.PortName = "IP_169.254.110.160"
objPrinter.DeviceID = "ScriptedPrinter"
objPrinter.Location = "USA/Redmond/Building 37/Room 114"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "ScriptedPrinter"
objPrinter.Put_
 
I have a lot of printer. HP, OKI,...
isn't possible use my format:

PC=inputbox("In wich PC did you want to install?")
impresora=inputbox("What printer do you like to install?")


??????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top