Anothername Posted July 25, 2018 Posted July 25, 2018 We have had some new printers set up on our network, and the old printers have been removed. We use a log on script(batch file) on our Server 2008r2 and in the past I have just added in the REM rundll32 printui.dll,PrintUIEntry /dn /n \\SERVER\printername to the login batch file and it has worked without issue in removing the old print share when staff and pupils log on. This now does not appear to be working to remove the old print share....am I missing something or any idea's? Thanks
djm968 Posted July 25, 2018 Posted July 25, 2018 (edited) You need to remove the REM statement e.g. rundll32 printui.dll,PrintUIEntry /dn /n \\SERVER\printername https://www.computerhope.com/jargon/r/rem.htm Edited July 25, 2018 by djm968 1
LeMarchand Posted July 25, 2018 Posted July 25, 2018 Before we used Group Policy for this, our script was a vbs. ' Script to remove existing network printers and add current ones ' Declare variables and enumerate existing printer connections On Error Resume Next Set WshNetwork = WScript.CreateObject("WScript.Network") Set Printers = WshNetwork.EnumPrinterConnections ' Delete existing connections to network printers For i = 0 to Printers.Count - 1 Step 2 If Left(ucase(Printers.Item(i+1)),2) = "\\" Then WSHNetwork.RemovePrinterConnection Printers.Item(i+1) End IF Next ' Add printers and set as default WshNetwork.AddWindowsPrinterConnection "\\Server\Printer1" WshNetwork.AddWindowsPrinterConnection "\\Server\Printer2" WshNetwork.AddWindowsPrinterConnection "\\Server\Printer3" WshNetwork.SetDefaultPrinter "\\Server\Printer2" There were various versions that different groups got with a different set of printers and default.
bald_pig Posted July 25, 2018 Posted July 25, 2018 you need to remove REM, that marks a comment instead of a command (REMark)
Oaktech Posted July 25, 2018 Posted July 25, 2018 Does the delete action in GPP printers not clear them out?
Anothername Posted July 26, 2018 Author Posted July 26, 2018 Thanks....can't believe I missed that and has done the trick. 1
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