Solved

Script to remove certain printers

Posted on 2014-12-02
5
101 Views
Last Modified: 2014-12-04
Dear Experts,

I have tried using scripts so that a user can run to automatically remove certain printers.

Our current installed printers are IP printers and they all start with the same 3 letter code but the 4th character changes.

Is there a script that can be executed in order to remove a printer or printers?

Thank you in advance
0
Comment
Question by:IATA-techops
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:valmatic
ID: 40476189
here you go
https://www.interworks.com/blogs/smatlock/2014/03/31/using-logon-scripts-add-and-remove-network-printers

Just because this site calls it a logon script does not mean it can't be used in general it certainly can be run manually etc...
0
 

Author Comment

by:IATA-techops
ID: 40477110
Still unable to run it

From this code: I only want to remove printers from a local machine.

I have removed the Add printer part and added my server name, however receive a character error.

My server name is mia-fs2     and the printer is mia-61, could you tell me where i should enter this info correctly so the script can execute?

 set objNetwork = CreateObject(“WScript.Network”)
objNetwork.RemovePrinterConnection “\\Your_print_server\printer_name_being_removed”
objNetwork.AddWindowsPrinterConnection “\\Your_print_server\printer_name_being_added”
0
 

Author Comment

by:IATA-techops
ID: 40478356
?
0
 
LVL 7

Accepted Solution

by:
valmatic earned 500 total points
ID: 40480480
a local machine is a little different like so...
http://community.spiceworks.com/scripts/show/1612-delete-one-local-printer
0
 

Author Closing Comment

by:IATA-techops
ID: 40480868
n/a
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now