Solved

VBS PrinterRemoval

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
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.

770 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