On a side note (kinda), got some more ".bat" info that may help clean up the modules (gotta love me!).
Here is a "lengthy" (not that bad) test module; read it; some is good, some you may ignore...
@ECHO OFF
:::::::::::: From STARTPCH.BAT
:: I look for a different module because I use a more efficient method..
:: IF NOT EXIST .\bin\ASET.exe goto aPROBLEM
IF NOT EXIST .\bin\NSET.com goto aPROBLEM
goto GoSTART
:aPROBLEM
echo.
echo. Hi there. The program can't continue (ya-dee-yah...)
echo.
echo. Please press any key to exit ...
PAUSE >nul
goto END
:GoSTART
:: This gets the Where-I-Execute-From-directory...
:: Notice how a SINGLE INSTRUCTION LINE will DIRECTLY set %LOCATE%
:: This is more dependable because I can navigate to the primary folder
:: in a DOS box and it STILL WORKS (old method gets NULL(?) value)
:: .\bin\ASET LOCATE := FPATH('%0')
:: .\bin\ASET TP := LEN('%LOCATE%')-1
:: .\bin\ASET LOCATE := LEFT('%LOCATE%',%TP%)
:: SET TP=
CD | ".\BIN\NSET" LOCATE=$1
:::::::::::: From AUTOPACH.BAT ; %LOCATE% is now "x:\folder"
:: check for necessary program files
FOR %%! in (ASET.EXE GETVER.EXE NSET.COM) DO IF NOT EXIST "%LOCATE%\bin\%%!" goto MISSING
:: I added these (It adds two more and includes LOCATE.COM as well...)
FOR %%! in (GETEL.BAT FINDCD.COM LOCATE.COM) DO IF NOT EXIST "%LOCATE%\bin\%%!" goto MISSING
:: =========
GOTO GOTEMALL
:MISSING
echo. MISSING error (BTW, the label ":MISSING" is MISSING...)
goto aPROBLEM
:GOTEMALL
:: =================== A LITTLE NEW CODE FROM HERE DOWN =================
:: This gets both the Windows-drive and the Where-I-Execute-From-drive...
:: Notice how the first two instructions will DIRECTLY set %windrive%
SET HDD=%windir%
"%LOCATE%\BIN\ASET" HDD := LEFT('%HDD%',2)
"%LOCATE%\BIN\ASET" IAM := LEFT('%LOCATE%',2)
GOTO MAIN1
:MAIN0
::: junk... commented out
::: CALL "%LOCATE%\TESTX"
:::
ECHO. Wanna go again? (y or n)
choice>nul /c:yn /n
:: This translates the ERRORLEVEL to something useable (binary to ASCII)...
:: Convenient if you are using Structured Programming....
:: Useable in your routines??? (My intent for modifying v1.95!!!)
:: Notice this is a "CALL"; that means it WILL return TO NEXT INSTRUCTION!
:: (as long as CALL'ed does NOT "EXIT"!
CALL "%LOCATE%\BIN\GETEL"
:: Notice the usage of ERRORLEVEL in branching...
:: No "IF" Statements for ERRORLEVEL Here!
GOTO MAIN%ERRORLEVEL%
::::: Branch-to for Response=Y
:MAIN1
:: This gets a response from User into a variable...
:: Used in this test to find the CD-Rom that we need (via FINDCD)...
:: ANY name can be give, but MUST include the PATH (case NOT sensitive)!
:: example 1: SETUP.EXE <--on root
:: example 2: WIN98\OEMSETUP.EXE <--in Win98
Echo. Enter a Filename to find:
"%LOCATE%\BIN\NSET" CDN=$0
IF "%CDN%"=="" GOTO MAIN1
GOTO FINDNAM
::::: Branch-to for Response=N
:MAIN2
:: Clears remaining vars, then exits...
SET LOCATE=
SET HDD=
SET IAM=
SET CDN=
SET CDD=
SET ERRORLEVEL=
SET CMDLINE=
GOTO END
:FINDNAM
:: This attempts to find filename then sets where found (if at all)...
SET CDD=
"%LOCATE%\BIN\FINDCD" -f\%CDN% | "%LOCATE%\BIN\NSET" CDD=$1
"%LOCATE%\BIN\FINDCD" -f\%CDN% -e
CALL "%LOCATE%\BIN\GETEL"
IF "%ERRORLEVEL%"=="254" GOTO MAIN254
:: GOTO MAIN%ERRORLEVEL%
SET CDD=%CDD%:
ECHO. CD-Rom %CDD% found Finding %CDN%; HDD=%HDD% IAM=%IAM% LOCATE=%LOCATE%
GOTO MAIN0
:MAIN254
ECHO. CD-Rom not found Finding %CDN%; HDD=%HDD% IAM=%IAM% LOCATE=%LOCATE%
GOTO MAIN0
:::::::::::::::::::: DOS-window Test Result ::::::::::::::::::::::::
Microsoft® Windows 98
©Copyright Microsoft Corp 1981-1999.
C:\WINDOWS>cd ..\_findcd
C:\_findcd>test
Enter a Filename to find:
x
CD-Rom not found Finding x; HDD=C: IAM=C: LOCATE=C:\_findcd
Wanna go again? (y or n)
Enter a Filename to find:
win98\oemsetup.exe
CD-Rom D: found Finding win98\oemsetup.exe; HDD=C: IAM=C: LOCATE=C:\_findcd
Wanna go again? (y or n)
C:\_findcd>
++++ end of test output...
----- Notes on FINDCD.COM: -----
http://www.nu2.nu/download.php?sFile=findcd.zip Usage: findcd <option>
Option: -a All CD-Rom drive letters
-r Ready CD-Rom drive letters (with media)
-f<file> CD-Rom drive letters containing
sample: findcd -f\i386\setupldr.bin
-e Return errorlevel only
Returns errorlevel:
255: When CD-Rom extensions (MSCDEX) are not loaded
254: No drive(s) found
0-25: Drive letter of first CD-Rom (0=A, 1=B, ...)
----- Notes on GETEL.BAT: -----
http://www.fpschultze.de/smartfaq+faq.faqid+56.htm (provides the link to source and further info... VERY compact!)
Just "CALL" it... whatever was there will be translated...
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
BTW, "EXIT" goes COMPLETELY out of a module...
... also notice everything from last "GOTO MAIN0" to here
... (including the following "EXIT") is NOT GOING TO BE Syntaxed-out
... since they are NOT IN THE IN-STREAM CODE!!!
... Most script languages are generally considered "Compile/Load/Go",
.. similar to mainframe REXX (also availiable for PC), TSO, ISPF
EXIT.
:END
Also, GETEL.BAT has a good example of a FAST way to determine NOT-9x/ME...
Hope this helps...
l8tr... (gotta put more STUB code to test TABLE/Generic into this...)
P.S. don't forget to take some time out to relax to some tuneage; clears the peanut out!