delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/21/05:04:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <E562FCEE3A42D61192880002A5FB4333FF33BB@kite.pigroup.co.uk>
From: David Kilroy <david DOT kilroy AT pigroup DOT co DOT uk>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Setting default printer in startup scripts
Date: Wed, 21 May 2003 10:00:01 +0100
MIME-Version: 1.0

I've been using enscript for a while. Because lpr defaults to prn, I
explicitly specify the printer to use every time via a shell script.

I've now modified my .bash_profile to set the environment variable PRINTER
to the windows default printer as defined in the registry (see below). Would
it be worth adding this to cygwins .default/skel files?



Dave.


# Define default printer
if [ $OS = Windows_NT ]; then
  PRINTER=`regtool get '\user\Software\Microsoft\Windows
NT\CurrentVersion\Windows\Device'|sed 's?\([^,]*\),.*?\1?g'`
else
  PRINTER=`regtool get
'\config\System\CurrentControlSet\Control\Print\Printers\Default'`
fi

95/98/ME source:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B143274

NT/2000 sources:
http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b271257
http://techsupt.winbatch.com/TS/T000001031F14.html

Note: I haven't tested the above much. It works on my NT box with a network
printer, and I've verified an ME box has the appropriate registry entry.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019