DIM a
dim strip,strno
dim strprname,strDriverName
dim WshNetwork,strComputer
dim objWMIService,objPrinter
dim strPORTNAME
a = msgbox ("安裝與否",1,"印表機安裝")
'msgbox a
if a = 2 then wscript.quit
'Canon iR2200-3300 PCL6
'***********************************************************************
' print server IP PORT
'***********************************************************************
strip = "192.168.1.100" 'PRINTSERVER IP
strno = ""
strprname = "Canon2200"
strDriverName = "Canon iR2200-3300 PCL6"
'**************************************************************************
' dOS
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
strOS = objOperatingSystem.Caption
Next
'dO_ LPT1
IF strPORTNAME <> "Lpt1:" or strPORTNAME <> "Lpt2:" then
Call insprot
END IF
'**************************************************************************
'Installing a Printer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = strDriverName
objPrinter.PortName = strPORTNAME
objPrinter.DeviceID = strprname & "_" & strip
objPrinter.Network = True
objPrinter.Put_
'*******************************************************************************
'wLPORT (insprot)
sub insprot
'Installing Printer Ports
strComputer = "."
strPORTNAME = strprname
Set objWMIService = GetObject("winmgmts:")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = strPORTNAME
objNewPort.Protocol = 1
objNewPort.Queue = strpid
objNewPort.HostAddress = strip
objNewPort.SNMPEnabled = False
objNewPort.Put_
end sub
'*******************************************************************************
'end
'*******************************************************************************
2007年11月28日 星期三
訂閱:
張貼留言 (Atom)
RHEL install EPEL
https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...
-
記事本開啟 HKEY_CLASSES_ROOT\*\shell] [HKEY_CLASSES_ROOT\*\shell\NotePad] @="用記事本開啟" [HKEY_CLASSES_ROOT\*\shell\NotePad\command] @=...
-
https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...
-
download: https://download.owncloud.org/download/repositories/production/CentOS_7/noarch/owncloud-files-10.3.2-2.1.noarch.rpm https://d...
沒有留言:
張貼留言