hexbin Posted June 6, 2006 Share Posted June 6, 2006 I have a D-Link printer server. When installing it I create a connection to local prtinter trough a new printer port. I have Lexmark Z12 and it's drivers downloaded on my PC, but now, I would like to make an Unattended installation for it. Any idea??? Link to comment Share on other sites More sharing options...
The Glimmerman Posted June 10, 2006 Share Posted June 10, 2006 I use this vBscript for my deskjet 990cXistrComputer = "."Public ErrorSet WshShell = WScript.CreateObject("WScript.Shell")Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Deskjet990Function Deskjet990() Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_'Install TCP/IP Port : objNewPort.Name = "IP_192.168.0.5" objNewPort.Protocol = 2 objNewPort.HostAddress = "192.168.0.5" objNewPort.PortNumber = "515" objNewPort.Queue = "LPT1_PASSTHRU" objNewPort.SNMPCommunity = "public" objNewPort.SNMPEnabled = False objNewPort.Put_'Stop Spooler Service Set colServiceList = objWMIService.ExecQuery _ ("Select * from Win32_Service where Name='Spooler'") For Each objService In colServiceList errReturn = objService.StopService() WScript.Sleep 1000 Next'Start Spooler Service For Each objService In colServiceList errReturn = objService.StartService() WScript.Sleep 5000 Next WSHShell.run ("CMD.EXE /C RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b ""HP Deskjet 990CXi"" /f ""%WINDIR%\inf\ntprint.inf"" /r ""IP_192.168.0.5"" /m ""hp deskjet 990c"" /q /u"),0,true Set colInstalledPrinters = objWMIService.ExecQuery _ ("Select * from Win32_Printer Where Name = 'HP DeskJet 990CXi'") For Each objPrinter in colInstalledPrinters objPrinter.SetDefaultPrinter() WSHShell.run ("CMD.EXE /C RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n ""HP Deskjet 990CXi"" /a ""%SYSTEMDRIVE%\TEMP\DESKJET990CXi.DAT"" m p"),0,true NextEnd Function Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now