TGignac
asked on
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.AddWindowsPrint erConnecti on but for the life of me I cannot see where to add a printer that is a http printer.
I've tried WSHNetwork.AddWindowsPrint erConnecti on "\\http://<server>/<printer>" but it wont work.
Anyone have a solution or alternate way to achieve this goal?
Much appreciated.
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.AddWindowsPrint
I've tried WSHNetwork.AddWindowsPrint
Anyone have a solution or alternate way to achieve this goal?
Much appreciated.
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?
I think you will be accessing the embeded webserver using the http://Ipaddress.
is it a network printer?
ASKER
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.
It is not a network printer but a printer shared over the internet.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
That's great!
Can you try the below simple script?
Option Explicit
Dim netPrinter, UNCpath
UNCpath = "\\YourServer\PrinterName"
Set netPrinter = CreateObject("WScript.Netw
netPrinter.AddWindowsPrint
WScript.Echo "Your printer is mapped from : " & UNCpath
WScript.Quit
' End of example VBScript