Link to home
Start Free TrialLog in
Avatar of JeffBeall
JeffBeallFlag for United States of America

asked on

vbscript setup printer

I would like to use visual basic script to setup network printers on a remote pc.  this is what i have so far

Dim printer, UNCpath1, slash1, slash2, printername

slash2 = "\\"

slash1 = "\"

printername = InputBox("What printer do you want to be the default? ", "Create Default Printer")

UNCpath1 = InputBox("What server is this printer on? ", "Server")

Set printer = CreateObject("WScript.Network")

printer.AddWindowsPrinterConnection slash2 & UNCpath1 & slash1 & printername

WScript.Quit

It works if I run it on the computer I'm logged into. But I would like to run it on the computer that I am logged into, to install a printer on a remote computer.
Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JeffBeall

ASKER

thank you.