DOS Tips
  Home
Solutions
Services
Web Services
Docs
Download
Links
Archives
Contact
 žžžžž
 ŻŪŪŪŽ
 ŻŪŪŪŽ  ENHANCING DOS EDITOR (EDIT.COM)
 žžžžž


 Name: ED.BAT
 -----
 Type: DOS batch file
 -----
 Description: 
 ------------
  This utility uses /G flag of QBASIC.EXE with /EDITOR flag to have
  faster updates on a CGA Monitor.

  If you have a CGA Monitor then just key in the given Batch Script 
  and save it as ED.BAT. Use this file instead of EDIT.COM with the 
  following syntax -

       ED [[drive:][path]filename]
  
  EDIT.COM comes bundled with DOS and acts as the front-end for 
  invoking QBASIC.EXE in the MS-DOS Editor mode. Normally it resides 
  in the \DOS directory. ED.BAT also acts as a similiar front-end. 
  And for all practical purposes you can even delete EDIT.COM and 
  rename ED.BAT as EDIT.BAT and use it in place of EDIT.COM.

 Batch Script:
 -------------
        @echo off
        rem Run MS-DOS editor with FAST screen update
        rem on a CGA monitor 
        qbasic /g /editor %1

ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ


 žžžžž
 ŻŪŪŪŽ
 ŻŪŪŪŽ  ENVIRONMENT VARIABLES
 žžžžž


 Name: SEL.BAT
 -----
 Type: DOS batch file
 -----
 Purpose: 
 --------
  To effectively manage environment variables for various application.

 Description: 
 ------------
  Environment Varaiables(EVs) are used to control batch files and 
  programs behaviour. These are also used to control the way
  DOS appears and works. Some of the standard EVs are :
  PATH, PROMPT, SHELL etc. The variables can be user defined or
  set by any application when run. Some specific EVs may need to
  be set before some application can run.

  As more and more DOS applications are loaded in a system, the 
  list of EVs like PATH,etc. keep on increasing.This consumes 
  more memory and moreover in certain cases exceeds the default 
  environment size (256 bytes) reserved for EVs.
  Besides this the environment also gets cluttered with long PATH
  description and variables which make it difficult to read. 
  
  When an EV is set for some job, it has to be explicitly removed
  when the job is over and there is no more need for the EV.
  Secondly a copy of the current environment is always passed to
  the next program which is run whether the program requires it or
  not.  If the program is memory resident(TSR) then the duplicate 
  environment copy also stays in the memory thus tying up RAM space
  needlessly.

  The batch file SEL.BAT provides an easy way to manage the EVs.
  Before running any application the EVs can be set as per 
  requirement and when the work is over they can be cleared out.

  Basically SEL.BAT is a simple menu driven program which accepts
  the user's choice and sets the EVs specific to any application
  selected by the user. The user input is accepted by CHOICE.COM,
  a program bundled with DOS 6.0 onwards, and returns an ERRORLEVEL
  number based on which key the user had pressed. Instead of CHOICE 
  the program ASK, from Norton Utilities, can also be used.

  SEL.BAT can be modified to suit individual systems. The modification
  has to be carried out in three parts (as labelled in the SEL.BAT 
  file).

  Part 1 - MENU :
  Here add the menu heading you want to display for your application.
  And add the selected trigger key to the CHOICE command line.
  Ensure each trigger key is unique for each menu option.

  Part 2 - IF CONDITIIONALS :
  Add an IF line with proper ERRORLEVEL number and a goto label.

  Part 3 - EV SETUP MODULES: 
  Add in all the EVs to be set up for the application and any other
  actions to be taken.

  You should also add any EVs which need to be cleared/modified after
  the application is over to the RESET module.

Batch Script:
-------------
@ECHO OFF
rem =========== Begin Part - 1  MENU ===========================

echo      SET ENVIRONMENT
echo      ===============
echo W: Windows         C: Clipper         F: Foxpro
echo T: Turbo C++       X: Xbase           G: Games
echo D: Turbo Debug     E: Display Env.    R: Reset Env.
echo.

rem Add the trigger letter of any newly added menu option in the
rem choice command below :
choice /c:WCERFTXGD  /n "Select : "

rem =========== End Part - 1    MENU ===========================


rem =========== Begin Part - 2  IF CONDITIONALS =================

if errorlevel == 9 goto TDEBUG
if errorlevel == 8 goto GAMES
if errorlevel == 7 goto XBASE
if errorlevel == 6 goto TURBOC
if errorlevel == 5 goto FOX
if errorlevel == 4 goto RESET
if errorlevel == 3 goto END
if errorlevel == 2 goto CLIP
if errorlevel == 1 goto WIN

rem ============ End Part - 2   IF CONDITIONALS ================= 


rem ============ Begin Part - 3  EV SETUP MODULES ===============

rem SETUP MODULE FORMAT
rem :
 Updated: 03, Jan, 2003
info@mandals.net