button_ripple Posted September 16, 2008 Posted September 16, 2008 I need a script which can delete an old printer connection, then re-install the printer to a new server path. Can anyone help me with this?
plexer Posted September 16, 2008 Posted September 16, 2008 'Remove ALL old printers 'Enumerate all printers first, after that you can select the printers you want by performing some string checks Set WSHPrinters = WNet.EnumPrinterConnections For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2 'To remove only networked printers use this If Statement If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then WNet.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True End If 'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above 'WNet.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True Next 'end delete existing printers 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