Solved

VBS PrinterRemoval

Posted on 2014-02-11
6
180 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
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
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…

757 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

18 Experts available now in Live!

Get 1:1 Help Now