home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.misc
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!cbnews!shurr
- From: shurr@cbnews.cb.att.com (larry.a.shurr)
- Subject: Re: where should SET name=thing go?
- Organization: AT&T Bell Laboratories, Columbus, OH
- Date: Fri, 18 Dec 1992 20:20:28 GMT
- Message-ID: <1992Dec18.202028.15794@cbnews.cb.att.com>
- References: <Bz8HIA.B9M@knot.ccs.queensu.ca> <1992Dec14.065220.19796@cdf.toronto.edu> <1992Dec14.151847.17868@midway.uchicago.edu>
- Lines: 58
-
- In article <1992Dec14.151847.17868@midway.uchicago.edu> pynq@midway.uchicago.edu writes:
- }In article <1992Dec14.065220.19796@cdf.toronto.edu> g1nickut@cdf.toronto.edu (Nick Zahariadis) writes:
- }> 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...
- }I think it also gets run when you launch a WIN/OS2 session...
-
- Correct.
-
- }This presents a problem for those of us who are used to having long,
- }involved AUTOEXECs...
- }[Need a way to distinguish interactive and non-interactive DOS sessions].
-
- }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?
-
- Yes, nice trick. Pity to have to trick it, though. In another thread
- in this forum, someone from IBM asked (paraphrased), "would the ability
- to specify the AUTOEXEC file help?"
-
- I would answer this question yes. I have found it to be so because I
- have made use of a feature of 4DOS to do that very thing. What I've
- done is change the definition of SHELL in CONFIG.SYS to point to
- 4DOS.EXE, however, I omitted including "/p" or any other arguments in
- the definition (actually, I think that I could leave the /p). Instead,
- I put these things in the shell pathname setting under the DOS settings
- menu in the program object. This setting existed, but could not be
- changed from the default provided by CONFIG.SYS in the 2.0 GA. Now,
- however, in the SP, you can change it -- hurrah!
-
- With 4DOS, if you specifiy a directory pathname as an argument, 4DOS
- will look in that directory for a file called 4DOS.INI. In 4DOS.INI,
- you can specify the file to use as the AUTOEXEC file. It's a little
- bit roundabout, but it works well. I really only have two AUTOEXEC
- files, one for interactive sessions and one for WINOS2 and specific
- DOS programs started from an OS/2 program object, but it's possible
- to have all manner of custom AUTOEXEC files for every occasion :-).
-
- Larry
- --
- Larry A. Shurr (las@cbnmva.att.com) speaking only for myself.
- Norman, listen carefully. I am lying. Are you sure your circuits are
- registering? Your ears are green. Logic is a little bird singing in a
- meadow. Logic is a wreath of pretty flowers which smell bad! - Mr. Spock
-