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.
LVL 1
TGignacAsked:
Who is Participating?
 
chandru_solCommented:
0
 
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.