HP Designjet Universal Print Driver - System Administrator's Guide

HP DJ UPD SAG
33
if configVerbosity = 1 then
wscript.echo strShellLine
end if
lShellResults = objShell.Run(strShellLine,1,True)
if lShellResults = 1 then
wscript.echo "Error on driver instalation. Contact with your IT administrator"
ShowHelp
end if
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function allows the user to add new TCPIPport on computer
' Input Params:
' - hostAddress: The IP address or hostname of the port
' - portName: Name of the port
' Output Parms:
' - N/A
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function AddTCPIPPort(hostAddress, portName)
Dim objWMIService, objNewPort
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objNewPort = objWMIService.Get ("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = portName
objNewPort.Protocol = 1
objNewPort.HostAddress = hostAddress
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function allows the user to add new LOCALport on computer
' Input Params:
' - portName: Name of the local port
' Output Parms:
' - N/A
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function AddLocalPort(portName)
Dim wmiSvc, spooler, reg
Const HKLM = &h80000002
Set wmiSvc = GetObject("winmgmts:\\.\root\cimv2")
Set spooler = wmiSvc.Get("Win32_Service.Name='spooler'")
Set reg = GetObject("winmgmts:root\default:StdRegProv")
spooler.StopService
reg.SetStringValue HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports", portName, ""
spooler.StartService
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function recover the params gived by user
' Input Params:
' - N/A
' Output Parms: