Removing printer connections 
Author Message
 Removing printer connections

Hi,

I am trying to get a script to remove network printer
connections from users PC's, but cannot get the following
to work
---------------------------------
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.RemovePrinterConnection "\\PrintServer\Printer"
----------------------------------

It gives the following error message

Error:  This network connection does not exist.

Code:   800708CA
Source: WshNetwork.RemoveNetworkDrive

Anyone any ideas?

Regards,
Brian



Tue, 06 Jul 2004 01:33:09 GMT  
 Removing printer connections
The RemovePrinterConnection method removes both Windows and MS-DOS based
printer connections. If the printer was connected using the method
AddPrinterConnection, strName must be the printer's local name. If the
printer was connected using the AddWindowsPrinterConnection method or was
added manually (using the Add Printer wizard), then strName must be the
printer's UNC name.

http://www.wsh.winisp.net/help/default.asp?jumpurl=html/wsMthRemovePr...
nnection.htm

Regards,
Ian


Quote:
> Hi,

> I am trying to get a script to remove network printer
> connections from users PC's, but cannot get the following
> to work
> ---------------------------------
> Set WshNetwork = WScript.CreateObject("WScript.Network")
> WshNetwork.RemovePrinterConnection "\\PrintServer\Printer"
> ----------------------------------

> It gives the following error message

> Error: This network connection does not exist.

> Code: 800708CA
> Source: WshNetwork.RemoveNetworkDrive

> Anyone any ideas?

> Regards,
> Brian



Tue, 06 Jul 2004 02:22:41 GMT  
 Removing printer connections
RemovePrinterConnection has a bug in all WSH versions prior to 5.6.

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Hi,

> I am trying to get a script to remove network printer
> connections from users PC's, but cannot get the following
> to work
> ---------------------------------
> Set WshNetwork = WScript.CreateObject("WScript.Network")
> WshNetwork.RemovePrinterConnection "\\PrintServer\Printer"
> ----------------------------------

> It gives the following error message

> Error: This network connection does not exist.

> Code: 800708CA
> Source: WshNetwork.RemoveNetworkDrive

> Anyone any ideas?

> Regards,
> Brian



Tue, 06 Jul 2004 09:03:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Remove Printer Connection

2. Remove printer connection

3. Please Help - Removing Printer Connections

4. Removing Printer Connections

5. Remove Printer Connection

6. Enumerate Registry Keys and Remove Printer Connections

7. Remove printer connection

8. Remove printer connection

9. Removing Network Printer Connections

10. Removing Printers

11. Add / Remove Printers

12. Remove Shared Printers on PC's

 

 
Powered by phpBB® Forum Software