home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / enved.zip / ENVED.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-09  |  3KB  |  65 lines

  1. /*********************************************************************
  2.  *                                                                   *
  3.  * ENVED - An Environment Editor                                     *
  4.  *                                                                   *
  5.  * enved.cmd  Invoke the OS/2 environment editor                     *
  6.  *                                                                   *
  7.  *********************************************************************
  8.  * This is an OS/2 full screen or windowed command prompt program to *
  9.  * present a copy of the current environment variables in an easily  *
  10.  * editable format.  The current settings can be changed or deleted  *
  11.  * and new variables may be added, all from the full screen inter-   *
  12.  * face.                                                             *
  13.  *                                                                   *
  14.  * Usage:                                                            *
  15.  *                                                                   *
  16.  *   ENVED [var1] [var2] [...]                                       *
  17.  *                                                                   *
  18.  * Where:                                                            *
  19.  *                                                                   *
  20.  *   var1, var2 etc. are a list of specific environment variables    *
  21.  *   to be edited.  If none are supplied the current complete en-    *
  22.  *   vironment is presented.                                         *
  23.  *                                                                   *
  24.  * This program will run under OS/2 1.3 and OS/2 2.0 or later.  It   *
  25.  * requires REXX to be installed and the ENVED.DLL to be available   *
  26.  * in the LIBPATH.                                                   *
  27.  *                                                                   *
  28.  * By: Tim Baldwin                                                   *
  29.  *     IBM UK Laboratories, Hursley Park, Winchester, UK             *
  30.  *     BALDWINT at WINVMB            GBIBMN56 at IBMMAIL             *
  31.  *     baldy@vnet.ibm.com                                            *
  32.  *********************************************************************
  33.  *     (C) Copyright IBM Corporation 1993.  All rights reserved.     *
  34.  *********************************************************************/
  35.  
  36. /* Most of the work is done by functions in the ENVED.DLL. */
  37. /* Ensure we have access to this DLL.                      */
  38.  
  39.  call RxFuncAdd "EnvEdit", "ENVED", "ENVED"
  40.  if RxFuncQuery("EnvEdit") <> 0 then do
  41.     say "ENVED Error: cannot locate ENVED.DLL."
  42.     say ""
  43.     say "ENVED requires access to ENVED.DLL.  Please ensure this"
  44.     say "file is available in a directory listed in your LIBPATH."
  45.     exit 1
  46.  end
  47.  
  48. /* Display the full screen edit panel */
  49.  
  50.  arg list
  51.  count = EnvEdit("environ", list)
  52.  
  53. /* On return from the edit panel call REXX to perform required */
  54. /* environment changes.                                        */
  55.  
  56.  do i = 1 to count
  57.     parse var environ.i envvar"="envval
  58.     rc = value(envvar, envval, "OS2ENVIRONMENT")
  59.  end
  60.  
  61. /* Return to OS/2 */
  62.  
  63.  exit 0
  64.  
  65.