Solved

VBS PrinterRemoval

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…

895 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

15 Experts available now in Live!

Get 1:1 Help Now