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

RemovePrinterConnection Error

Status
Not open for further replies.

CoolClark

MIS
Mar 9, 2001
352
US
Has anyone used RemovePrinterConnection? When I run the script below it works fine adding the printer:

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server\printer"

Then I change the script to this:

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.RemovePrinterConnection "\\server\printer"

I get a popup error:

Script: printer.vbs
Line: 2
Char: 1
Error: This network connection does not exist.

Code: 800708CA
Source: WSHNetwork.RemoveNetworkDrive

I don't understand why source in the above error is RemoveNetworkDrive

If anyone has run into this error I could sure use some help.

TIA
Coolclark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top