delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/21/05:11:24

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
Date: Wed, 21 May 2003 11:11:07 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Re: Setting default printer in startup scripts
Message-ID: <20030521091107.GF30676@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
References: <E562FCEE3A42D61192880002A5FB4333FF33BB AT kite DOT pigroup DOT co DOT uk>
Mime-Version: 1.0
In-Reply-To: <E562FCEE3A42D61192880002A5FB4333FF33BB@kite.pigroup.co.uk>
User-Agent: Mutt/1.4.1i

On Wed, May 21, 2003 at 10:00:01AM +0100, David Kilroy wrote:
> # 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
> 
> 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.

The backslashes are somewhat dangerous since they get evaluated as
special characters.  Why not use forward slashes instead?  regtool
supports them as registry key separator.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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