Solved

Script to remove certain printers

Posted on 2014-12-02
5
104 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

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
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

839 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