lennyd33 Posted September 2, 2006 Share Posted September 2, 2006 I know it can be done..... just cant find a working solution.....Esentially on a windows based network, I would like a way to install a ip network printer to a number of workstations with printer config as well ( trays, multfeeder, duplexing)anyone have a working solution - im a scripting noob Link to comment Share on other sites More sharing options...
beto0918 Posted September 2, 2006 Share Posted September 2, 2006 Do you have access to an active directory?If so the way i did was by creating a group called 2nd floor printersand added the users to this group.then i wrote a login script (push with a group policy under user config)the script look something like thisOn Error Resume NextDim WshNetwork, WshShellSet objNetwork = CreateObject("Wscript.Network")strUser = objNetwork.UserNameSet WshNetwork = WScript.CreateObject("WScript.Network")Set objFSO = CreateObject("Scripting.FileSystemObject")fComputername = WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")if isMember("2nd Floor Printers")then'******this creates a file so it won't reinstall the printers on next log on*************If objFSO.FileExists("C:\Documents and Settings\" & strUser & "\My Documents\2ndFloorPrinters.tst") then Set objFolder = objFSO.GetFile("C:\Documents and Settings\" & strUser & "\My Documents\2ndFloorPrinters.tst")Else objFSO.CopyFile "\\server001\PrintersScripts\2ndFloorPrinters.tst" , "C:\Documents and Settings\" & strUser & "\My Documents\", OverwriteExisting'*****This deletes all network printers already installed***************************strComputer = "."Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colInstalledPrinters = objWMIService.ExecQuery _ ("Select * from Win32_Printer Where Network = TRUE")For Each objPrinter in colInstalledPrinters objPrinter.Delete_Next AddPrinter "\\server001\printer001" AddPrinter "\\server001\printer002"End ifEnd ifLet me know if this help Link to comment Share on other sites More sharing options...
Vits Posted September 6, 2006 Share Posted September 6, 2006 (edited) @Lennyd33,I do have AD, but only one printer, (one floor space of html coders, not much printing) but it has A3 and a A4 tray (NZ paper sizes, not letter format), so here is my lazy way of not learning scripting The following doesnt do the remote install per say, I use AD/login scripts to run the files below, as I also use the same script on the RIS install. Its not flash, but it does the job. I use a post install script ofstart /wait wscript %systemdrive%\install\setprint.vbsregedit /s %systemdrive%\install\photocopier-on-prak-dc01.regThe Setprint.vbs is'// Name: setprint.vbs'// Description: Add a network printer and make it the defaultSet WshNetwork = CreateObject("WScript.Network")'// Adds the printer. Substitute your server name and printer share.WshNetwork.AddwindowsPrinterConnection "\\prak-dc01\photocopier-a3"WshNetwork.AddwindowsPrinterConnection "\\prak-dc01\photocopier-a4"'// Makes the specified printer the default.WshNetwork.SetDefaultPrinter "\\prak-dc01\photocopier-a4"The Photocopier-on-PRAK-DC01.reg Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\Printers\Connections][HKEY_CURRENT_USER\Printers\Connections\,,prak-dc01,Photocopier-A3]"Server"="\\\\prak-dc01""Provider"="win32spl.dll""DevMode"=hex:5c,00,5c,00,70,00,72,00,61,00,6b,00,2d,00,64,00,63,00,30,00,31,\ 00,5c,00,50,00,68,00,6f,00,74,00,6f,00,63,00,6f,00,70,00,69,00,65,00,72,00,\ 2d,00,41,00,33,00,00,00,4c,00,20,00,36,00,00,00,00,00,01,04,28,01,dc,00,6c,\ ... lots of lines of hex deleted for readabilty[HKEY_CURRENT_USER\Printers\Connections\,,prak-dc01,Photocopier-A4]"Server"="\\\\prak-dc01""Provider"="win32spl.dll""DevMode"=hex:5c,00,5c,00,70,00,72,00,61,00,6b,00,2d,00,64,00,63,00,30,00,31,\ 00,5c,00,50,00,68,00,6f,00,74,00,6f,00,63,00,6f,00,70,00,69,00,65,00,72,00,\ 2d,00,41,00,34,00,00,00,4c,00,20,00,36,00,00,00,00,00,01,04,28,01,dc,00,6c,\ 04,03,4f,00,00,01,00,09,00,b3,0d,b0,09,64,00,01,00,01,00,58,02,01,00,01,00,\ ... lots of lines of hex deleted for readabiltyTo get the code above for the reg import, setup the printer on a test/your machine, set the paper trays if required, then export the HKCU\Prineters\Connections .In my situation, I create a Printer entry per paper type, so when the luser (not a typo) goes file/print, they only have to select this printer for this paper size or that printer for that paper size, even though its printed on the same physical printer, just different paper sizes.Saves the luser asking all the stupid questions that one gets Edited September 6, 2006 by Vits 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