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

Re: Portable NB batch file



** Reply to message from Michael Norman 
on Sat, 13 Sep 2008 13:01:22 -0400

Here's a revision to this LAUNCHNB.BAT. Works perfectly here:

@echo off
setlocal
::
:: --------------------------
:: LAUNCHNB.BAT for Portable Nota Bene RJHolmgren 4 Dec 2004
Rev.18 Sept 08
::
:: User Variable (1):
:: Set variable NBFOLDER below to the "\path" where NB is located
set NBFOLDER=\NB8
:: --------------------------
::
if not exist Z:\ goto begin
echo Drive Z: already in use! Aborting...
goto :eof
:begin
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y) do (
 if exist %%a:%NBFOLDER%\SWSYS.DLL (
  subst Z: %%a:%NBFOLDER%
  pushd Z:
  start /min /wait NOTABENE.EXE
  popd
  subst Z: /D
  goto :eof
 ) )
echo NotaBene portable installation not found

==============================

> When I run it from a cmd prompt [F:\ launchnb] on a host machine

No space char!

> I get "the syntax of the command is not correct." The first obvious
> place to check was to make sure I'd substituted the right variable
> for SET NBFOLDER= , which I did. Then it occurred to me, that I
> might have to map the Z: drive on the host machine first

The whole point of the BATfile is to SUBSTitute the Z: drive
for your actual d:\path_to_NB on your thumb drive or whatever it
is. If you're going to do that manually, then why run the
BATfile?

> since *Z:* at the
> cmd prompt turned up "The system cannot find the drive specified."

Well, of course. The success of the BATfile **requires** that
Z: not be in current use, because if it IS in use then it can't
be SUBSTituted.

> I'm not sure how to proceed.

Look, stare at the BATfile until you "get" the logic of it -- it
is really very simple. Then test this out first on your regular
machine, not using a thumb drive. If you don't want to launch
NB during the tests, remove the line that says "start /min /wait
NOTABENE.EXE" and replace it with "echo OK" or "dir" or "cd" or
something benign and quick. When you see that it actually
works, move it to your thumb drive and try it there... And make
sure that you adjust the variable NBFOLDER to the actual \path
(sans "driveletter:") of your NB installation.

Now, in principle and in general, this sort of procedure will
launch any program portably on Z:, but running NBWin
successfully with this depends on a lot of things, e.g. whether
NB.INI points at Z: in its many little details. So to ensure
that it works with NB specifically, NB should have been
initially installed on your thumb drive with the thumb assigned
as Z: -- you can't just XCOPY your installation on F: or C: to
your thumb drive. If you install it on Z:, then NB will think
it is operating on Z:\ and it will (or should) work.

R.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------