This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove Cygwin Path for Called Batch Script

"Scott Wegner" <> wrote in message">
... 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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]