By David Wiseman (Administrator)Created 11 Feb 2008
My Rating:
Vote
Rating:
Not Rated
Views:10362
Downloads:138

Delete a Printer

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 No Windows NT No
Vista Unknown Windows 2008 Unknown
Description

Deletes a printer named ScriptedPrinter.

Code

Line Numbers: On  Off      Plain Text
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters =  objWMIService.ExecQuery _
    ("Select * from Win32_Printer where DeviceID = 'ScriptedPrinter'")

For Each objPrinter in colInstalledPrinters
    objPrinter.Delete_
Next

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
laloine
Posted On: 7/2/2019 2:18:56 PM [Edited 7/2/2019 2:21:10 PM]

I know about the site, I have found great thoughts about deleting printer,thanks for sharing. We all using the online resume review services site for great writing thoughts and we have learned how to write essays.

sleepbush
Posted On: 9/10/2019 4:50:21 AM

All mario games for Free!


Posted On: 10/9/2019 9:07:44 AM

Not as beautiful and not as radiant as the dawn, but the sunset makes many sobbing, bewildered by the beauty and tranquility of the end of the day. 2 player games

nguyenthaovan0606
Posted On: 12/17/2019 9:00:59 AM

Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial. gmail sign up hotmail email login

worldnew29
Posted On: 12/20/2019 4:20:40 AM

Ethanol-This is another good cleaner that you can use. It is very effective but doesn't perplex it with Isopropyl alcohol which ought to never ever be made use of inside the container. Economical Vodka-It's not a house product however when you get it, it will work best for your container. Worldvaping


Posted On: 12/20/2019 7:18:27 AM

Download text twist 2 3D

kayleig
Posted On: 2/5/2020 2:32:35 AM

Everything is great. And it is more wonderful to find a form of entertainment, bring creative thinking. Come right to our game. surviv io