awistaiw
12-17-2002, 02:19 AM
I have successfully mapped a printer to \\server\printer using a script, and now want to remove it using a script. The RemovePrinterConnection method pops up an error, "This network connection does not exist.", with the source of the error as the method RemoveNetworkDrive(!) Any ideas? I copied the code straight off the tutorial posted on the site, and edited it so it pointed to the printer share.
Here is the code for reference anyway:
Set WshNetwork = WScript.CreateObject("WScript.Network")
'remove a remote mapping
WshNetwork.RemovePrinterConnection "\\link1\HP Upstairs"
Do I perhaps need to make it a local connection rather than a UNC share in the RemovePrinterConnection method's parameters?
Thanks in advance,
Alastair
Here is the code for reference anyway:
Set WshNetwork = WScript.CreateObject("WScript.Network")
'remove a remote mapping
WshNetwork.RemovePrinterConnection "\\link1\HP Upstairs"
Do I perhaps need to make it a local connection rather than a UNC share in the RemovePrinterConnection method's parameters?
Thanks in advance,
Alastair