envset

  • Upload
    jamesyu

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 envset

    1/2

    ENVSET.COM Documentation.

    Version 1.0August, 1989

    (c) 1989 John Sloan.(John Sloan, Compuserve 73727,2162)

    PURPOSE:This utility is used in a batch file to set an environment variable

    to a value or create a new environment variable.

    An example would be if you had a replacement for the DOS "TYPE" command suchas the "BROWSER" utility which did not prompt you for a filename if youjust issued the command "BROWSER" but instead gave you a nasty error message.This utility can get around this by letting the batch file prompt you for afilename, as it does in the example below.

    USAGE:To use it, the batch file command is:

    "envset TEMP.BAT ENAME"where:-TEMP.BAT is the name of a temporary batch file which will containthe fully written command to set the environment variable.-ENAME is the environment variable you wish to use.

    EXAMPLES:

    Listing of file browse.bat:

    @echo offif not "%1" == "" goto nameecho Please enter the filename to be browsed,echo and press "Enter":c:\tools\envset c:\temp01.bat tempnamecall c:\temp01.batc:\utils\browser %tempname%set tempname=del c:\temp01.batgoto end:namec:\utils\browser %1

    :end

    If a filename is entered at the command line after the command "BROWSE",then the utility BROWSER in directory c:\TOOLS is executed. If the command"BROWSE" is entered with no filename to be browsed, then ENVSET is run toask for interactive input to get a filename to be browsed.

    The utility ENVSET will ask for a filename to be entered, then set theenvironment variable "tempname" to that filename. It then runs the"BROWSER" utility with that filename as input and then gets rid of theextra TEMP.BAT file and the unnecessary environment variable TEMPNAME

  • 8/14/2019 envset

    2/2

    that we are finished using.

    We have the "BROWSER" utility in C:\UTILS and envset utility in C:\TOOLSand we set up the temporary batch file TEMP99.BAT in the root directory.

    Copyright/License/Warranty--------------------------

    This document and the program file ENVSET.COM ("the software") arecopyrighted by the author. The copyright owner hereby licensesyou to: use the software; make as many copies of the program anddocumentation as you wish; give such copies to anyone; anddistribute the software and documentation via electronic means.There is no charge for any of the above.

    However, you are specifically prohibited from charging, orrequesting donations, for any such copies, however made; andfrom distributing the software and/or documentation withcommercial products without prior permission. An exception isgranted to not-for-profit user's groups, which are authorized to

    charge a small fee (not to exceed $7) for materials, handling,postage, and general overhead. NO FOR-PROFIT ORGANIZATION ISAUTHORIZED TO CHARGE ANY AMOUNT FOR DISTRIBUTION OF COPIES OFTHE SOFTWARE OR DOCUMENTATION, OR TO INCLUDE COPIES OF THESOFTWARE OR DOCUMENTATION WITH SALES OF THEIR OWN PRODUCTS.

    THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFITORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITHOTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE ORANY OTHER SUCH FEE FOR THE DISTRIBUTION. NO FOR-PROFITORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIAFOR WHICH MONEY IS CHARGED.

    There is no restriction on the use of this software incommercial or institutional environments.

    No copy of the software may be distributed or given away withoutthis document; and this notice must not be removed.

    There is no warranty of any kind, and the copyright owner is notliable for damages of any kind. By using this free software,you agree to this.

    First Edition (August 1989)

    (c) John Sloan 1989