Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: From: David Kilroy To: "'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 Content-Type: text/plain; charset="iso-8859-1" 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/