[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Running multiple configurations of vDosXy



I've been experimenting with running multiple instances, or alternate
configurations, of vDosXy. It's easy, and the good news is that you do NOT
need to install vDosXy multiple times; a single installation will do.

A key point to remember is that when you start vDos.exe, it searches for
CONFIG.TXT and AUTOEXEC.TXT in the Windows path, starting in the current
directory. The current directory is not necessarily the directory with
vDos.exe, so if you have differing copies of CONFIG.TXT and AUTOEXEC.TXT
sprinkled around various directories, you may get unexpected results. To
avoid surprises, you really need to confine your CONFIG.TXT and AUTOEXEC.TXT
files to a single directory -- i.e., the one that contains vDos.exe.

So, how to maintain multiple/alternate configurations? The easiest way, I
think, is to have pairs of CONFIG and AUTOEXEC files with matching extensions
other than ".TXT" in the directory that contains vDos.exe. For example,
CONFIG.1, AUTOEXEC.1; CONFIG.2, AUTOEXEC.2; etc. If you want to launch
configuration "2", you simply log into the directory that contains vDos.exe,
and copy CONFIG.2 to CONFIG.TXT and AUTOEXEC.2 to AUTOEXEC.TXT immediately
before starting vDos.exe. This is easily done by launching vDos.exe with a
BATch file. I've written one, vDosXy.bat (below), which automates the
directory-change and file-copying and traps the most likely error -- a
misspelled or non-existent configuration extension. The usage is simple:

VDOSXY.BAT [ext]

where [ext] is the extension of the CONFIG-AUTOEXEC pair that you want to
activate upon launching vDos.exe.

Before using vDosXy.bat, you'll need to edit it in one or two places. First
-- this is required -- edit the lines that switch to the drive and directory
that contain vDos.exe on your system. Second, if you wish, edit the line that
controls vDosXy.bat's default behavior, i.e., what happens when you command
VDOSXY.BAT without any argument. If you leave it as is, it will simply launch
vDosXy using the current copies of CONFIG.TXT and AUTOEXEC.TXT in the
directory with vDos.exe. You may wish to edit it so that, by default, it
starts a specified configuration. You do this by editing the line:

:: if %1! == ! set cfg=1

as follows: delete the initial ":: " and change "set cfg=1" to "set
cfg=ext",
where "ext" is the extension of the CONFIG-AUTOEXEC pair that you wish to
launch by default. (If your default configuration extension is "1", all you
need to do is delete the initial ":: ".)

You can set Desktop shortcuts to your various vDosXy configurations by
setting the "target" property to d:\path\vDosXy.bat ext.

Even if you only run one instance of XyWrite, you may still find it
convenient to have a second configuration of vDosXy that simply displays the
DOS prompt. All the more convenient if, like me, you run XyWrite with
different color schemes and different versions (3 vs. 4), and other DOS
programs. (For me, 'tis the season to run the excellent CalMaster 2000 --
still, IMO, the best calendar program anywhere. Grab it here (my Hannukah
present): http://users.datarealm.com/ammaze/xfer/CM2000.ZIP; unzip all
files into a directory of your choosing and issue CM2000.EXE at the DOS
prompt to launch. It works fine in vDosXy, except that, for some reason, you
can't launch it from AUTOEXEC.TXT; you have to manually issue CM2000 at the
DOS prompt. Same behavior in the original vDos.)

Here's vDosXy.bat:

:: start vDosXy.bat
@echo off
::
:: Drive and directory with vDos.exe
:: Edit as necessary:
::
F:
cd \vDosXy
::
:: Defaults configuration (default = use current AUTOEXEC and CONFIG files)
if %1! == ! goto start
:: Alternative (recommended):
:: Use a specified extension as default (here, "1")
:: if %1! == ! set cfg=1
::
:: Do NOT change the following lines:
if %cfg%! == ! set cfg=%1
if exist config.%cfg% (
 if exist autoexec.%cfg% (
  for %%f in (autoexec config) do copy %%f.%cfg% %%f.txt > nul
  set cfg=
  :start
  vDos.exe
 )) else (
  echo.
  echo "CONFIG|AUTOEXEC.%cfg%" not found in directory with vDos.exe
  echo.
  set cfg=)
:end


Gut Yontif!

--
Carl Distefano
cld@xxxxxxxx