• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 570
  • Last Modified:

VBScript to add http printer

OK everyone... I'm stumped.

I need to be able to add an http printer to clients using a vbs login script.
I currently map all of my organizations printers using the WSHNetwork.AddWindowsPrinterConnection but for the life of me I cannot see where to add a printer that is a http printer.

I've tried WSHNetwork.AddWindowsPrinterConnection "\\http://<server>/<printer>" but it wont work.

Anyone have a solution or alternate way to achieve this goal?

Much appreciated.
0
TGignac
Asked:
TGignac
  • 4
  • 2
1 Solution
 
chandru_solCommented:
You need not user http

Can you try the below simple script?

Option Explicit
Dim netPrinter, UNCpath
UNCpath = "\\YourServer\PrinterName"
Set netPrinter = CreateObject("WScript.Network")
netPrinter.AddWindowsPrinterConnection UNCpath
WScript.Echo "Your printer is mapped from : " & UNCpath
WScript.Quit
' End of example VBScript
0
 
chandru_solCommented:
What is the printer you are referring to as http printer?

I think you will be accessing the embeded webserver using the http://Ipaddress.

is it a network printer?
0
 
TGignacAuthor Commented:
http Printer... a printer shared with a URL, not a UNC. When you add a printer using the print wizard in Windows XP, you have the ability to add a printer by URL. This is a IPP or sometimes referred to as an http printer.

It is not a network printer but a printer shared over the internet.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
chandru_solCommented:
0
 
TGignacAuthor Commented:
Thanks chandru sol

I ended up with using this command in my vbscript:

wshShell.Run "rundll32 printui.dll,PrintUIEntry /b ""<Printer Name>"" /x /n ""<Printer Name>"" /if /f %windir%\inf\ntprint.inf /r ""http://<URL/Printer>"" /m ""<Printer Driver Name>(i.e.HP Color Laserjet PS)""", TRUE
0
 
chandru_solCommented:
That's great!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now