FN-GM Posted December 27, 2007 Posted December 27, 2007 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 1
arran Posted December 27, 2007 Posted December 27, 2007 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
Ric_ Posted December 27, 2007 Posted December 27, 2007 This has been discussed MANY times before. Please look at the wiki for full details.
FN-GM Posted December 27, 2007 Author Posted December 27, 2007 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
Ric_ Posted December 27, 2007 Posted December 27, 2007 @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.
Recommended Posts