X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: "Michael Kairys" Subject: Re: Remove Cygwin Path for Called Batch Script Date: Tue, 25 Mar 2008 12:37:58 -0400 Lines: 23 Message-ID: References: <47E8FE86 DOT 9020405 AT hdfgroup DOT org> <47E90794 DOT 3010406 AT sbcglobal DOT net> <47E909C3 DOT 3010408 AT hdfgroup DOT org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit In-Reply-To: <47E909C3.3010408@hdfgroup.org> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Note-from-DJ: This may be spam "Scott Wegner" wrote in message news:47E909C3 DOT 3010408 AT hdfgroup DOT org... > ... However, I'd rather find a solution where the batch script can remain > "unaware" of its Cygwin context. Once I get things working, I plan on > creating bash script wrappers for many Windows batch scripts, so I'd like > to make the changes in the Cygwin environment, rather than editing each > batch script individually. What I do is have a batch file I call before executing any dos commands (sort of a ".dosrc"), and in that I set my dos path. So for example I have a bash function "dos" that looks like this: function dos() { local s=/c; if [ "$1" == "" ]; then s=/k; fi; cmd $s "%ETC%\login &" $*; } ... where %ETC%\login.bat is my ".dosrc" file. This enables me to say to bash, "dos" and get a dos prompt, or "dos foo" and execute foo in a dos context. LIkewise for things such as shortcuts to cmd.exe, I use "cmd.exe /k %ETC%\login". I know this is not exactly what you're looking to do but perhaps something similar might work in your case. -- 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/