VBS scrip error Code: 800708CA

Posted on 2011-10-18
Medium Priority
Last Modified: 2012-05-12
Hello all,

I have this script below which works fine to remove a printer, but when the printer is removed and the printer is no longer mapped, the script produce an error. Is anyone know what I need to do to stop the error if the printer is not available ?

error msg:- " This network connection does not exist." Code: 800708CA

Option Explicit
Dim DelPrint, UNCpath
UNCpath = "\\printserver\printname"
Set DelPrint = WScript.CreateObject("WScript.Network")
DelPrint.RemovePrinterConnection UNCpath, true, true
Wscript.Echo "This printer was removed : " & UNCpath

Thank you
Question by:IT Department
  • 2
LVL 51

Accepted Solution

Netman66 earned 2000 total points
ID: 36992464
Add the line: On Error Resume Next

Do this under the Option Explicit line.


Assisted Solution

by:IT Department
IT Department earned 0 total points
ID: 36999774
Worked, I did use this line before but I gues I have it in the wrong place. Thank you for been specific.

Author Closing Comment

by:IT Department
ID: 37023045

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question