Created
February 5, 2015 18:50
-
-
Save pleonex/68beb0e0f8c06c1f76c6 to your computer and use it in GitHub Desktop.
Reinstall a HP Network Printer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objWMIService2 = GetObject("winmgmts:") | |
Set objNewPort2 = objWMIService2.Get _ | |
("Win32_TCPIPPrinterPort").SpawnInstance_ | |
objNewPort2.Name = "IP_192.168.1.16" | |
objNewPort2.Protocol = 1 | |
objNewPort2.HostAddress = "192.168.1.16" | |
objNewPort2.PortNumber = "9100" | |
objNewPort2.SNMPEnabled = False | |
objNewPort2.Put_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo Cleaing printer queue. . . | |
net stop spooler > null | |
del /F /Q C:\WINDOWS\system32\spool\PRINTERS\* | |
net start spooler > null | |
echo Uninstalling printer. . . | |
printui.exe /dl /n "HP Officejet 6000" | |
timeout 5 /nobreak > null | |
echo Installing network printer. . . | |
cscript C:\Users\MyUser\Desktop\hp.vbs > null | |
printui /if /b "HP Officejet 6000" /f %windir%\inf\ntprint.inf /r "IP_192.168.1.16" /m "HP Officejet 6000 E609a Series" | |
timeout 5 /nobreak > null | |
echo Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment