HP DesignJet T3500 System Administrator s Guide - Page 32

Set objShell = WScript.CreateObject WScript.shell

Page 32 highlights

HP DJ UPD SAG 'Get printer name from inf ReadInf infFile, printer if configVerbosity = 1 then wscript.echo "Candidate Printer Name = " + printer end if driverName = """" + printer + """" ' Check the actual name of queue printers installed to choice the name that we use to install new queue CheckPrinterName printer if configVerbosity = 1 then wscript.echo "Final Printer Name = " + printer end if ' Add Port if local = 0 then AddTCPIPPort hostAddress, portName else if not (PortExists(portName)) then AddLocalPort portName if configVerbosity = 1 then wscript.echo "Restarting the spooler..." end if WScript.Sleep(10000) end if end if ' Install Driver and Printer DoInstall printer, infFile, portName, driverName, configVerbosity ' Share printer if needed if configSharing = 1 then SharePrinter printer end if wscript.echo "Installation Done" end sub This function allows the user to install new Driver and Printer on client ' Input Params: ' - printer: The Printer Name ' - infFile: Full path of INF file ' - portName: Port name ' - strDriver: Driver name ' Output Parms: ' - N/A Public Function DoInstall (printer, infFile, portName, strDriver, configVerbosity) Dim strShellLine, lShellResults, objShell Set objShell = WScript.CreateObject ("WScript.shell") strShellLine = "rundll32 printui.dll, PrintUIEntry /if /b " + printer + " /f " + infFile + " /r " + portName + " /m " + strDriver 32

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

HP DJ UPD SAG
32
'Get printer name from inf
ReadInf infFile, printer
if configVerbosity = 1 then
wscript.echo "Candidate Printer Name = " + printer
end if
driverName = """" + printer + """"
' Check the actual name of queue printers installed to choice the name that we use to install new queue
CheckPrinterName printer
if configVerbosity = 1 then
wscript.echo "Final Printer Name = " + printer
end if
' Add Port
if local = 0 then
AddTCPIPPort hostAddress, portName
else
if not (PortExists(portName)) then
AddLocalPort portName
if configVerbosity = 1 then
wscript.echo "Restarting the spooler..."
end if
WScript.Sleep(10000)
end if
end if
' Install Driver and Printer
DoInstall printer, infFile, portName, driverName, configVerbosity
' Share printer if needed
if configSharing = 1 then
SharePrinter printer
end if
wscript.echo "Installation Done"
end sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function allows the user to install new Driver and Printer on client
' Input Params:
' - printer: The Printer Name
' - infFile: Full path of INF file
' - portName:
Port name
' - strDriver: Driver name
' Output Parms:
' - N/A
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function DoInstall (printer, infFile, portName, strDriver, configVerbosity)
Dim strShellLine, lShellResults, objShell
Set objShell = WScript.CreateObject ("WScript.shell")
strShellLine = "rundll32 printui.dll, PrintUIEntry /if /b " + printer + " /f " + infFile + " /r " + portName + " /m " +
strDriver