Re: Add printer to all users?
- From: "Randy Reimers" <rreimers.nul@xxxxxxxxxxx>
- Date: Wed, 23 May 2007 13:40:04 -0500
A batch file can add printers to the computer in HKLM, that puts it in for
all users.
------------sample file begin------------
rundll32 printui.dll,PrintUIEntry /ga /n\\printserver\printershare /j"LanMan
Print Services"
sc stop spooler
sc start spooler
------------sample batch file ends------
The entry - "/ga" is best thought of as "Global Add" - to remove the
printer, change to "/gd" - "Global Delete"
Once added, you cannot delete the printer through the control panel - run
the batch file again, changing the line to read /gd first.
This could be run from a vb script, or otherwise. You will need to be at
least a "Power User", if not an Administrator.
Randy Reimers
"TimM" <TimM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CBBF5F16-9747-4493-A545-8BC59EA62E90@xxxxxxxxxxxxxxxx
Is it possible to add a printer to all users. I have bene trying to work
out
a script that will install based on group membership but has becom a
daunting
task. So I'm also toying with the notion of installing printer from the
admin
account when I set up the users PC but the only problem is that network
printers are user based. Can you install a network printer from one
account
and have it show up on all the users accounts that login to the PC?
My script at least for now to install printers is:
Option Explicit
Dim strOption, objNetwork, strTitle
strTitle = "Printer Install"
StrOption = Inputbox ("Select Printer Desired", strTitle)
If strOption = 1 Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection "\\servername\printer"
objNetwork.SetDefaultPrinter "\\servername\printer"
End If
If strOption = 2 Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection "\\servername\printer2"
objNetwork.SetDefaultPrinter "\\servername\printer2"
End If
Also on a side note, how do you make multiple lines in a message box or a
input box? I know in HTML it's as easy as <br> to insert a line break.
Thanks a million.
--
Thanks
TimM
.
- Prev by Date: Re: Sleep until any keystroke
- Next by Date: window.showModalDialog Question
- Previous by thread: Re: Add printer to all users?
- Next by thread: VBScript to find the Terminal Service services on the list of computers
- Index(es):
Relevant Pages
|