Printer Install Script: How to Define Printer Trays?



I have a working printer install script, but I am lacking the ability
to define Printer Trays.
So, I still need to touch the desktop to define what tray prints to
what kind of paper.

I understand that each printer driver have different tray
configurations.
I am working with HP LaserJet 42xx series printers.
The trays available to me are:
1. Automatically Select
2. Printer Auto Select
3. Manual Feed in Tray1
4. Tray1
5. Tray2
6. Tray3


In the following example, how would I code the script to define the
correct Printer Tray?


<job id="Add_WORK-Hun1">
<script language="VBscript">
dim r
r = MsgBox("This script will install the WORK-HunU printer to
your
computer." & vbCrLf & _
" on TCP/IP port 10.252.11.18. To continue, Press
OK.",VbOKCancel,"Install WORK-Hun1 Printer")


If r = vbCancel Then WScript.Quit


Set objWMIService = GetObject("winmgmts:")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_10.252.11.18"
objNewPort.Protocol = 1
objNewPort.HostAddress = "10.252.11.18"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_


Set objDriver = objWMIService.Get("Win32_PrinterDriver")
objDriver.Name = "HP LaserJet 4250 PCL 6"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
errResult = objDriver.AddPrinterDriver(objDriver)


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root
\cimv2")
Set objPrinter =
objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "HP LaserJet 4250 PCL 6"
objPrinter.PortName = "IP_10.252.11.18"
objPrinter.DeviceID = "WORK-HunU"
objPrinter.Network = False
objPrinter.Shared = False
objPrinter.Put_


</script>
</job>

.



Relevant Pages

  • FULLY configure printers thru scripting/CLI
    ... while I will be specifically talking about HP print drivers ... I need a way to, for example, automatically (thru a script or some other ... handle is printing to a specific paper tray. ...
    (microsoft.public.development.device.drivers)
  • Re: How do you close wscript.exe after vbs file is run?
    ... Si Ballenger wrote: ... Is there something that can be added to the vbs script to cause ... why is the FOR loop repeated? ... then the second loop tries to eject an already ejected tray. ...
    (microsoft.public.scripting.vbscript)
  • Printer Install Script: How to Define Printer Trays?
    ... I have a working printer install script, but I am lacking the ability ... I still need to touch the desktop to define what tray prints to ...
    (microsoft.public.scripting.vbscript)
  • Re: Make gDesklets start at login
    ... I think because it runs in the tray. ... I'm sure I can write a little script to start it, but I'm having brain-lock right now, can't remember which dot-file the commands should go in. ... You have found the bank of Larn. ... I speak only for myself, and I am unanimous in that! ...
    (Fedora)

Loading