' Author
martin junge
' Version
0.1 - 16-7-2014
'
-----------------------------------------------'
Option
Explicit
Dim
objWMIService, objItem, colItems, strComputer, intPrinters
strComputer
= "."
intPrinters
= 1
dim strtemp,
strtemp1, strtemp2, strDrucker, strRegkey, WshShell
Set
objWMIService = GetObject _
("winmgmts:\\"
& strComputer & "\root\CIMV2")
Set colItems
= objWMIService.ExecQuery _
("SELECT
* FROM Win32_Printer")
On Error
Resume Next
For Each
objItem In colItems
if (instr(objItem.DriverName, "HP")) then
'WScript.Echo "Printer: " & objItem.DeviceID &
", " & objItem.DriverName
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
strDrucker = objItem.DeviceID
strtemp =
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\"
'----
strtemp1 = "\PrinterDriverData\SSNPNotifyEventSetting"
strRegkey = strtemp & strDrucker & strtemp1
'wscript.echo strRegkey
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite strRegkey, 0, "REG_DWORD"
'----
strtemp2 = "\PrinterDriverData\SSNPDisableAll"
strRegkey = strtemp & strDrucker & strtemp2
'wscript.echo strRegkey
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite strRegkey, 1, "REG_DWORD"
'----
end if
intPrinters
= intPrinters + 1
Next
WScript.Quit
' End of
Sample Printer VBScript
Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u.
ReplyDeleteSupport for 123 HP Printers
Thanks for the informative blog...
ReplyDelete123 HP Officejet Pro 8736 Setup
A very interesting article. The insights are really helpful and informative. Thanks for posting.
ReplyDelete123 HP Officejet Pro Setup 8736
thanks for your informative post.its helpful to understand it.keep blogging
ReplyDeletehp officejet pro 8736 printer
Hey, nice site you have here! Keep up the excellent work!
ReplyDelete123 HP Install