home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.misc
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!quads!pynq
- From: pynq@quads.uchicago.edu (Jeremy Mathers)
- Subject: Re: where should SET name=thing go?
- Message-ID: <1992Dec14.151847.17868@midway.uchicago.edu>
- Sender: news@uchinews.uchicago.edu (News System)
- Reply-To: pynq@midway.uchicago.edu
- Organization: D. J. Dougherty & Associates
- References: <Bz8HIA.B9M@knot.ccs.queensu.ca> <1992Dec14.065220.19796@cdf.toronto.edu>
- Date: Mon, 14 Dec 1992 15:18:47 GMT
- Lines: 48
-
- In article <1992Dec14.065220.19796@cdf.toronto.edu> g1nickut@cdf.toronto.edu (Nick Zahariadis) writes:
- ...
- > Just to pull the rug from under your feet, OS/2 does NOT use the
- > 'Autoexec.Bat' file AT ALL. Go ahead and move it to a floppy; OS/2 will
- > still boot its merry way into your system.
- >
- > The 'Autoexec.Bat' is there for DOS sessions only. Therefore the 'SET'
-
- The tricky part of this, as I indicated in another post, is that
- AUTOEXEC.BAT gets runs for *all* simulated DOS sessions (but not for
- "specific DOS"), which means that when you launch a DOS program from
- within a OS/2 session, the window that gets launched runs AUTOEXEC.
- I think it also gets run when you launch a WIN/OS2 session, but I am not
- sure - I read something somewhere that indicated you could not have
- anything that paused for input in AUTOEXEC.BAT if you were using WIN/OS2.
-
- This presents a problem for those of us who are used to having long,
- involved AUTOEXECs (mine are usually several screens long, and involving
- much environment testing/looping/asking questions. There needs to be
- a way to do this stuff only when you are spawning an interactive DOS
- session; otherwise you want to have a streamlined AUTOEXEC that
- basically contains only SET statements. It turns out that OS/2 goes out
- of its way to make this difficult. It is nothing short of diabolical.
-
- After much playing, I found a way to do it. (You'll love this!)
- In your notebook for the interactive DOS session Icon, you put /E:1024
- in the Parameters box. What this does is set the env size to 1024 only
- for the interactive sessions. Now all you have to do is be able to
- detect this fact in the AUTOEXEC.BAT. I had written, some time back, a
- program called READVAR (freeware availble upon request) that, among
- other things, can tell you how large your environment is. When run with
- no args, READVAR will write a brief usage msg to stdout, including a
- display of the current env size. Thus, my AUTOEXEC contains the
- following:
-
- readvar | grep 1024 >nul
- if errorlevel 1 goto not_interactive_shell
- ... (interactive shell stuff here)
-
- Pretty cool, eh?
-
- ************************************************************************
- Swipple's Rule of Order:
- He who shouts the loudest has the floor.
-
- - pynq@quads.uchicago.edu, who is still costing the net
- hundreds, if not thousands, of dollars, every time he posts -
- ************************************************************************
-