Jump to content

Recommended Posts

Posted

Hi there

 

I currently use vbs script to map network printers. We have changed printers recently and all is fine with the script (below)

 

Dim net

Set net = CreateObject("Wscript.Network")

net.AddWindowsPrinterConnection "\\curricsvr\ictcolour"

net.AddWindowsPrinterConnection "\\curricsvr\reprophotocopier"

net.AddWindowsPrinterConnection "\\curricsvr\receptionphotocopier"

 

 

What I need to know is how I delete the old ones from appearing in the users printers list. I have deleted these off the print server but the icons still appear on users with "unable to connect". Can someone using my script above edit it to make it do what I need. The old printers names were:

\\curricsvr\ictmono

\\curricsvr\planning

 

Thanks

Posted (edited)

net.RemovePrinterConnection "\\curricsvr\ictmono"
net.RemovePrinterConnection "\\curricsvr\planning"

 

Should work.

 

(There's also option to force remove if you want to add paramters etc)

 

Edit - Just to expand:

 

Example:
net.RemovePrinterConnection ("\\curricsvr\ictmono", true, true)

  bForce  : Force the removal of the mapped printer. 
           (Boolean Optional, default = false). 
  
  bUpdateProfile : Save changes in the user's profile
                  (Boolean Optional, default = false)

 

 

Steve

Edited by Steve21
Posted

Thanks Steve

 

I will give this a go but I thought I had tried that previously. Do I just add the lines under my existing script?

 

When you gave me the alternative to add parameters....what will this do as opposed to the one above

 

Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...