Solved

VBS PrinterRemoval

Posted on 2014-02-11
6
188 Views
Last Modified: 2014-03-08
What command line is required for the attached “PrinterRemoval” VBS to remove printers for all users on a Laptop or PC?  Thank You
PrinterRemoval.txt
0
Comment
Question by:tbrewer48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Accepted Solution

by:
Niabingi earned 500 total points
ID: 39850454
try this

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\LAGSPRN01\LAGPIS100"
WshNetwork.RemovePrinterConnection PrinterPath, true, true
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 39850519
niabingi:
Won't that only delete the priners for hte logged in user ?
0
 
LVL 4

Expert Comment

by:Niabingi
ID: 39850551
if the previous script does not remove all the printers for all users, this should work.

I have used this in a batch file, add a seperate entry for each printer installed

Reg Delete "hkcu\Printers\connections\,,LAGSPRN01\LAGPIS100" /f
Reg Delete "hkcu\Printers\connections\,,LAGSPRN01\LAGPISxx" /f
Reg Delete "hkcu\Printers\connections\,,LAGSPRN01\LAGPISxxx" /f
0
 

Author Comment

by:tbrewer48
ID: 39850883
The VBS. removed \\LAGSPRN01\LAGPIS100 only for one user
The BAT. didn't remove \\LAGSPRN01\LAGPIS100 from any user.
Any advice would be greatly appreciated?
0
 
LVL 59

Expert Comment

by:LeeTutor
ID: 39914620
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
0

Featured Post

To Patch or not to Patch? That is the question!

Don't get caught out like thousands of others around the world in the recent Ransomware Fiasco!
Discuss..
- Why it's not a good idea to wait before Patching
- Sensible approaches to Patching discussed
- Add your feedback, comments and suggestions

Question has a verified solution.

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

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

752 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