HP DesignJet Z5400 System Administrator s Guide - Page 33
reg.SetStringValue HKLM, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports, portName
View all HP DesignJet Z5400 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 33 highlights
HP DJ UPD SAG 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: 33