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

  1. Newsgroups: comp.os.os2.misc
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!cbnews!shurr
  3. From: shurr@cbnews.cb.att.com (larry.a.shurr)
  4. Subject: Re: where should SET name=thing go?
  5. Organization: AT&T Bell Laboratories, Columbus, OH
  6. Date: Fri, 18 Dec 1992 20:20:28 GMT
  7. Message-ID: <1992Dec18.202028.15794@cbnews.cb.att.com>
  8. References: <Bz8HIA.B9M@knot.ccs.queensu.ca> <1992Dec14.065220.19796@cdf.toronto.edu> <1992Dec14.151847.17868@midway.uchicago.edu>
  9. Lines: 58
  10.  
  11. In article <1992Dec14.151847.17868@midway.uchicago.edu> pynq@midway.uchicago.edu writes:
  12. }In article <1992Dec14.065220.19796@cdf.toronto.edu> g1nickut@cdf.toronto.edu (Nick Zahariadis) writes:
  13. }> The 'Autoexec.Bat' is there for DOS sessions only. Therefore the 'SET'...
  14. }The tricky part of this, as I indicated in another post, is that
  15. }AUTOEXEC.BAT gets runs for *all* simulated DOS sessions...
  16. }I think it also gets run when you launch a WIN/OS2 session...
  17.  
  18. Correct.
  19.  
  20. }This presents a problem for those of us who are used to having long,
  21. }involved AUTOEXECs...
  22. }[Need a way to distinguish interactive and non-interactive DOS sessions].
  23.  
  24. }After much playing, I found a way to do it.  (You'll love this!)
  25. }In your notebook for the interactive DOS session Icon, you put /E:1024
  26. }in the Parameters box.  What this does is set the env size to 1024 only
  27. }for the interactive sessions.  Now all you have to do is be able to
  28. }detect this fact in the AUTOEXEC.BAT.  I had written, some time back, a
  29. }program called READVAR (freeware availble upon request) that, among
  30. }other things, can tell you how large your environment is.  When run with
  31. }no args, READVAR will write a brief usage msg to stdout, including a
  32. }display of the current env size.  Thus, my AUTOEXEC contains the
  33. }following:
  34.  
  35. }    readvar | grep 1024 >nul
  36. }    if errorlevel 1 goto not_interactive_shell
  37. }    ...    (interactive shell stuff here)
  38.  
  39. }Pretty cool, eh?
  40.  
  41. Yes, nice trick.  Pity to have to trick it, though.  In another thread
  42. in this forum, someone from IBM asked (paraphrased), "would the ability
  43. to specify the AUTOEXEC file help?"
  44.  
  45. I would answer this question yes.  I have found it to be so because I
  46. have made use of a feature of 4DOS to do that very thing.  What I've
  47. done is change the definition of SHELL in CONFIG.SYS to point to 
  48. 4DOS.EXE, however, I omitted including "/p" or any other arguments in 
  49. the definition (actually, I think that I could leave the /p).  Instead,
  50. I put these things in the shell pathname setting under the DOS settings
  51. menu in the program object.  This setting existed, but could not be 
  52. changed from the default provided by CONFIG.SYS in the 2.0 GA.  Now,
  53. however, in the SP, you can change it -- hurrah!
  54.  
  55. With 4DOS, if you specifiy a directory pathname as an argument, 4DOS
  56. will look in that directory for a file called 4DOS.INI.  In 4DOS.INI,
  57. you can specify the file to use as the AUTOEXEC file.  It's a little
  58. bit roundabout, but it works well.  I really only have two AUTOEXEC
  59. files, one for interactive sessions and one for WINOS2 and specific
  60. DOS programs started from an OS/2 program object, but it's possible
  61. to have all manner of custom AUTOEXEC files for every occasion :-).
  62.  
  63. Larry
  64. -- 
  65. Larry A. Shurr (las@cbnmva.att.com) speaking only for myself.
  66. Norman, listen carefully.  I am lying.  Are you sure your circuits are
  67. registering?  Your ears are green.  Logic is a little bird singing in a
  68. meadow.  Logic is a wreath of pretty flowers which smell bad! - Mr. Spock
  69.