Sub set_port_b3p2()
	Set args = WScript.Arguments
	printerPortName = "IP_147.162.140.80"
	tcpipAddress    = "147.162.140.80"
	tcpipPortNumber = 9100
	Set objWMIService = GetObject("winmgmts:")
	Set objNewPort = objWMIService.Get _
	("Win32_TCPIPPrinterPort").SpawnInstance_
	objNewPort.Name = printerPortName
	objNewPort.Protocol = 1
	objNewPort.HostAddress = tcpipAddress
	objNewPort.PortNumber = tcpipPortNumber
	objNewPort.SNMPEnabled = False
	objNewPort.Put_
End Sub

Sub install_b3p2_32()
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set oShell = WScript.CreateObject ("WScript.Shell")
	oShell.Run("rundll32 PrintUI.dll,PrintUIEntry /if /b ""Olivetti 5001 amministrazione"" /f """ & fso.GetAbsolutePathName(".") & "\KXDriver\64bit\OEMSETUP.INF"" /m ""Olivetti d-COPIA 5001MF KX"" /r ""IP_147.162.140.80""")
End Sub

set_port_b3p2()
install_b3p2_32()

