VBscript & Active Directory and printers ? (continued)

Posted on Thursday, 25th October, 2007 in Life

As I posted earlier, I tried working around some limitations in Microsoft’s Active Directory by teaching the script some intelligence.

But, since we recently started using Thin Clients, all the stuff I did with the fancy vbs was just a waste-of-time. Turns out, Windows XP Embedded doesn’t work quite the same as a “normal” Windows XP (that’s where I tested the script on), and it simply dies when running the WMI Query. Bollocks.

So I switched back, utilizing a shortcut in Startup, but pointing to the shortened vbs (see below) instead of the ugly batch file someone wrote.

Set WshNetwork = CreateObject("WScript.Network")
 
WshNetwork.AddWindowsPrinterConnection "\\nas.barfoo.org\Kyocera FS-9100DN KX"
' Set the default printer to something useful
WshNetwork.SetDefaultPrinter "\\nas.barfoo.org\Kyocera FS-9120DN KX"

But even that doesn’t work all the time, I still have to figure out why.


Leave a Reply