Re: Define 'local printer'?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 06/30/04


Date: Tue, 29 Jun 2004 18:30:15 -0700

Assuming the printers are all available as Windows Network printers and that
the Print Spooler is running on the local machine, I use the following
commands:

SETLOCAL
SET CMD_RUNDLL32=RUNDLL32.EXE
SET PRINTER_NAME1=\\PRINT-SERVER\NET-PRINTER1
SET PRINTER_DEFAULT=%PRINTER_NAME1%

%CMD_RUNDLL32% PrintUI.dll,PrintUIEntry /in /n %PRINTER_NAME1%
%CMD_RUNDLL32% PrintUI.dll,PrintUIEntry /y /n %PRINTER_DEFAULT%

REM Deletes the printer connection
REM %CMD_RUNDLL32% PrintUI.dll,PrintUIEntry /dn /n %PRINTER_DEFAULT%
ENDLOCAL

You need to come up with code to determine the UNC path of "PRINTER_NAME1".
The rest will make sure that the printer gets installed and becomes the
default printer for that user. I couldn't quite figure out how to rename
the network printer, though -- /b is supposed to work for local printers
(haven't tried).

Help:
rundll32 printui.dll,PrintUIEntry /?

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Gordon Price" <gordon(thorn)@thomashacker.com> wrote in message
news:OmsqB%23hXEHA.3944@tk2msftngp13.phx.gbl...
For reasons of AutoCAD ease of use, I would like to be able to define a
printer on each local machine, all called 'Local Printer' or 'Nearest
Printer' or some such, but have each desktop actually point this to one of
three physical printers. Ideally I would like to manage this with a script,
where the logon actually looks at what machine the user is logging on to,
and maps the local printer appropriately to the nearest phsysical device.
Failing that, it could be based on user group membership, but that would
mean a user logging in on a different machine would get output from the
printer defined by their usual desk location, not the machine they are
currently logged in at. Unfortunately, because of how AutoCAD plots, I can't
use the Default printer setting, I need to actually have a specific printer
name to work with.
So, first off, is there a better way to do this? Can script and/or Windows
Server get this affect some better way? And if not, can I do this as I am
thinking? Anyone done something similar?
Best,
Gordon


Relevant Pages

  • RE: get default printer?
    ... I recently wrote a similar script to migrate network printers. ... bSetDefault = False ... Msgbox "No network printers were found or modified.", vbinformation, ...
    (microsoft.public.scripting.vbscript)
  • Re: Leave the Default Printer Alone
    ... AddWindowsPrinterConnection nor AddPrinterConnection will set a printer as ... > script, and am seeing the following behavior. ... > Network Printers becomes the default printer at login, ...
    (microsoft.public.windows.server.scripting)
  • Re: Adding Missing printer if they not there
    ... But if this is your entire script, ... connecting to network printers). ... Const T = 1 ... checked only the network printers against our list to see if any of our ...
    (microsoft.public.windows.server.scripting)
  • Re: Adding Missing printer if they not there
    ... But if this is your entire script, ... connecting to network printers). ... Const T = 1 ... checked only the network printers against our list to see if any of our ...
    (microsoft.public.windows.server.scripting)