home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / os2 / misc / 39300 < prev    next >
Encoding:
Text File  |  1992-12-14  |  2.9 KB  |  61 lines

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