4 replies
by ewgny
Look at these resources
http://www.rlmueller.net/products.htm
Also newsgroups
Microsoft.public.windows.server.scripting
Microsoft.public.scripting.wsh
Microsoft.public.vbscript.wsh
Here is an example:
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server\AdminLaser
WshNetwork.SetDefaultPrinter "\\server\AdminLaser"
by yoram
if you want to run it in VB:
Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\servername\printername"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath
and if you are ok with command line you can alos create a batch file with the following:
rundll32 printui.dll,PrintUIEntry /in /u /z /n\\servername\printername
rundll32 printui.dll,PrintUIEntry /y /n\\servername\printername
The first command maps the printer and the second makes it default. You need to split this because otherwise your computer might attempt to make the printer default before it maps and give you an error.
Does it have to be VBS? How about this?
net use lpt3: \\computer\printer
Ralph
by drroberts
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending