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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete printer on local machine using batch files 3

Status
Not open for further replies.

cjpmcglinchey

Technical User
Sep 23, 2004
37
GB
Hi All

Can anyone tell me how to delete a printer off a local machine using a batch file.

Thanks in Anticipation

Chris
 
rundll32 printui.dll,PrintUIEntry /dl /n "printer name as it appears" /c\\computername

pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
Here is a script I got earlier on today. You need to copy it into notepad and save as VBS then put it as a logof script

' RemovePrinterConnection.vbs - Windows logon script
' VBScript to - Network Printer
' Author Guy Thomas ' Version 1.4 - April 24th 2005
' ------------------------------------------------------'
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\JANUS\ICT LAB 5500N"

Set objNetwork = CreateObject("WScript.Network")
' Section which removes the network printer
objNetwork.RemovePrinterConnection strUNCPrinter

'WScript.Echo "Check Printers folder NO: " & strUNCPrinter
Wscript.Quit

' Guy's Logon Script ends here
 
You will find some different examples in my FAQ.

faq329-5798

I hope you find this post helpful.

Regards,

Mark
 
Thanks for all your help, have been off work sick so going to give it a whirl on monday.

Thanks
again

Chris

Ps. is it at all possible to use wildcards for the computername.
 
Why do you need to use wildcards? The script examples in my FAQ will work on any PC you apply the script to.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top