Skip to content

Removing multiple network printers on workstation

Featured Replies

Can someone show me a sample of script that has an "if exist" statement that checks if the network printer is connected to the current PC.

 

I have this on part of my script that removes a network printer. But, I would like to add an "if exist" statement that checks and then removes if it does exist.

*******

Dim DelPrint, UNCpath

UNCpath = "\\server\network_printer1"

Set DelPrint = WScript.CreateObject("WScript.Network")

DelPrint.RemovePrinterConnection UNCpath, true, true

*******

 

Many thanks,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.