Jump to content

Recommended Posts

Posted

Hi

 

I know this has been talked about many times before but I am confused with it all. Let’s face it, doesn’t take much for me.

 

Right here we go, we didn’t add printers to an image last time we did them so i would like to add them now via a script. I would like the script to be as simple as possible I would like it to do the following:

- Delete Existing Network printers only

- Add 1 or 2 printers

- Make one printer default.

 

Thank you

 

Z

  • Thanks 1
Posted

Dim objNetwork, strPrinter

strPrinter = "\\servername\printername"
Set objNetwork = CreateObject("WScript.Network")

'Adding a printer
objNetwork.AddWindowsPrinterConnection strPrinter

'Setting a default printer
objNetwork.SetDefaultPrinter strPrinter

'Removing a printer
objNetwork.RemovePrinterConnection strPrinter

 

Adding - http://msdn2.microsoft.com/en-us/library/zsdh7hkb(VS.85).aspx

Removing - http://msdn2.microsoft.com/en-us/library/tsbh2yy7(VS.85).aspx

Setting a default - http://msdn2.microsoft.com/en-us/library/2ccwwdct(VS.85).aspx

Posted

As I highlighted before Ric, I have looked but I was lost by it all so I felt opening a new thread was the best way to go.

 

@arran please can you explain more? Thank You

Posted

@FN-Greatermanchester: There is a great deal of discussion already in other threads... a quick browse gives me:

 

http://edugeek.net/index.php?name=Forums&file=viewtopic&t=404

http://edugeek.net/index.php?name=Forums&file=viewtopic&t=13188

http://edugeek.net/index.php?name=Forums&file=viewtopic&t=1586

http://edugeek.net/index.php?name=Forums&file=viewtopic&t=501

 

Those are all found without using the search feature.

 

IMHO the wiki page is also very descriptive when it comes to this. I'm sure that if you read http://edugeekwiki.rm-charlton.net/index.php/Scripting_Printer_Addition_Based_on_Location everything is there.

 

Also try reading the MS examples at http://www.microsoft.com/technet/scriptcenter/default.mspx - this is where most of us learnt to do this scripting in the first place.

 

So you see there is no need for ANOTHER thread about this.

Guest
This topic is now closed to further replies.



×
×
  • Create New...