Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Script to remove TCP/IP Printers

Original Message
Name: ToPo (by topo)
Date: November 19, 2007 at 15:54:52 Pacific
Subject: Script to remove TCP/IP Printers
OS: Win XP MCE
CPU/Ram: 2.0GHz / 1 GB DDR
Model/Manufacturer: HP Pavilion
Comment:
Hello,

I am looking to create a batch file to remove all TCP/IP printers, but keep all local printers. Currently I tried using windows prnmngr.vbs but it either deletes all printers including Adobe PDF writer or I can specify which printers to delete within the cmd. I basically need to click on a button and "bye bye" IP printers. Any help would be very much appreciated.

Thanks


Report Offensive Message For Removal


Response Number 1
Name: tonysathre
Date: November 20, 2007 at 12:44:48 Pacific
Subject: Script to remove TCP/IP Printers
Reply: (edit)
::==rmNetPrinters.bat
@echo off
wmic printer where "Local='FALSE'" delete
::==

I don't have Adobe PDF Writer on my machine so I don't know if this will delete that or not. I would assume not because it should be listed as a local printer, but again, I'm not sure.

"Computer security." — Oxymoron


Report Offensive Follow Up For Removal

Response Number 2
Name: ToPo (by topo)
Date: November 20, 2007 at 16:06:31 Pacific
Subject: Script to remove TCP/IP Printers
Reply: (edit)
Thanks Tony... unfortunately TCP/IP printers are considered local printers not network printers. But I think I found a solution that works...

wmic printer where "PortName LIKE 'IP_%'" delete


Report Offensive Follow Up For Removal

Response Number 3
Name: mhouse
Date: January 8, 2008 at 05:51:35 Pacific
Subject: Script to remove TCP/IP Printers
Reply: (edit)
wmic printer where "PortName LIKE 'IP_%'" delete

The command above works well for me when executed locally, but fails when called via a URL? (I get "No Instance(s) Available.")

I'm trying to run this from a startup script in a machine GPO.

Any Suggestions would be greatly appreciated.

-MDH


Report Offensive Follow Up For Removal

Response Number 4
Name: ToPo (by topo)
Date: January 8, 2008 at 13:42:50 Pacific
Subject: Script to remove TCP/IP Printers
Reply: (edit)
I am using this command in a batch file called within a login script. If you are using it within a script you must put two %% as the command line will read one % as a special character. Two %% will read it as a single %. My command looks like this...

wmic printer where "PortName LIKE 'IP_%%'" delete

Hope that helps!


Report Offensive Follow Up For Removal

Response Number 5
Name: mhouse
Date: January 9, 2008 at 05:49:59 Pacific
Subject: Script to remove TCP/IP Printers
Reply: (edit)
That did it!

Thank you so much!

-MDH


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Script to remove TCP/IP Printers

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




how to setup call of duty to joytok

WindowsME / HotMail Problem

Corrupt memory

Convert fat32 to Ntfs

Best WinMo phone of 2008


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC