Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printers

Status
Not open for further replies.

dupas

Technical User
Aug 19, 2006
79
US
Im trying to remove printers from users PCs by using a VBScript. I know how to create one to add printers but not to remove them. The problem is Im not sure what printers they have on their PC so is there a way to remove a printer and if it isnt there to skip it and go to the next?

We changed print servers and I need to reload all printers to their PC.

Another question: If you have more than necessary printers on a PC will it slow down the PC?

Thanks!
 
You haven't supplied the code you are using, so I am assuming you are trying to do this using WMI. Which can get tricky if your clients are a mixture of Win2000 and XP. Why? Because both OS's use different classes for printers, still it can be done.

The other issue you face is that Printers are installed under each userprofile, so you would only be able to make changes to the current logged on user.
A better suggestion, which I pick-up from a mentor (I can't take credit for this - Thanks Paul!!!), is to use a logon script that connects to registry and makes changes to the printer values in HKEY_CURRENT_USER. This way changes will take affect when the user logs on.

Default printer info: HKCU\software\microsoft\windows nt\currentversion\windows\ Key is Device
Location of all printers: HKCU\software\microsoft\indows nt\currentversion\Devices

You would write your VBScript code to enumerate the values and Edit values by replacing the old printer values with the new values.







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top