home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / util2 / withlist.lzh / SETENV.ZIP / README next >
Text File  |  1988-05-29  |  2KB  |  46 lines

  1. Summary: setenv.arc - set environment variable based on user query
  2.  
  3. Note that this program is probably not portable because it uses a
  4. knowledge of MS-DOS's internal memory management.  It may not work with
  5. layered software such as DoubleDOS.  Given the UNIX process paradigm
  6. that MS-DOS uses, there is no portable way for a process to change its
  7. parent's environment.
  8.  
  9. This utility lets a BAT stream solicit values from a user.  It works
  10. and it is quick.
  11.  
  12. Version 1.1 fixes a minor bug in version 1.0.
  13.  
  14. SETENV 1.1  by Richard Marks
  15.  
  16.      Sets environment variables to a user response (for BAT files)
  17.  
  18.      SETENV  <envirn vbl name>  <prompt message>
  19.  
  20. Example:
  21.      setenv drv PLEASE ENTER DRIVE TO USE :
  22.  
  23. The message PLEASE ENTER DRIVE TO USE : is displayed on the console.
  24. The response is set into variable drv for use by the rest of the BAT file.
  25. For example:  copy *.FOO  %drv%:*.*
  26.  
  27. If there is a keyword instead of a <message>, SETENV will fill certain system
  28. values into the environment variable:
  29.  
  30.      SETENV  <envirn vbl name>  %cwd  -  get current working directory
  31.                                 %drive-  get default drive
  32.                                 %dosv -  get dos major version
  33. Use %% to represent a single % in BAT files
  34.  
  35. Multiple sets of arguments can be supplied:
  36.      SETENV <vbl> <msg> <vbl> <msg> . . .
  37.  
  38. ERRORLEVEL is set to 0 if successful, or is set to 1 if a problem.
  39. Possible problems are that the environment variable block cannot be
  40. found or is full.  (This version does not expand the environment block.)
  41. Or an invalid keyword is entered.
  42.  
  43. This routine does properly find and update the environment block of the
  44. parent COMMAND.COM process.  It sets the environment block of the innermost
  45. COMMAND.COM if multiple levels of call are involved.
  46.