Hello Mike,
> Very difficult and fragile.
>
> Here is an example based on one I found on the web:
>
> @SET cd=
> @SET promp%prompt%
> @PROMPT SET cd
> @CALL>%temp%.\setdir.bat
> @
> % do not delete this line %
> @ECHO off
> PROMPT %promp
> FOR %%c IN (CALL DEL) DO %%c %temp%.\setdir.bat
> set cwd=%cd%
> set libdir=%cd%\..\lib\gcl-2.5.0
> set unixportdir=%libdir%\unixport
> path %cd%\..\mingw\bin;%PATH%
> start %unixportdir%\saved_gcl.exe -dir %unixportdir% -libdir %libdir%
> -eval "(setq si::*allow-gzipped-file* t)" %1 %2 %3 %4 %5 %6 %7 %8 %9
Very strange, I obtain syntax errors under both Win98 and Win2k with the
above file ? Was your message corrupted by mailing, or is the file above
exactly what you sent?
The 1st syntax error I encountered is due to the line
@SET promp%prompt%
which ought (I think) to read:
@SET promp=%prompt%
otherwise the SET command defines no value for a variable named promp$P$G
(with the default prompt of Windows), instead of saving the value of the
variable PROMPT in the temporary variable PROMP (to reset later the prompt
at its original value, as it seems to be the aim?)
I would propose the following beginning of the file, tested under Win98
and Win2k (I apologize if it was a problem of corrupted mail, and
rediscovered what you originally wrote ! ) :
@rem #--- Part 1 for Win9x (95/98/ME)
@set curdir=
@set promp=%PROMPT%
@prompt set curdir$Q$P$_
@CALL>%temp%.\setdir.bat
@
%curdir%
@echo off
PROMPT %promp%
rem # Uncomment next 2 lines, to check
rem # if setdir.bat was created correctly under Win9x:
rem type %temp%.\setdir.bat
rem pause
FOR %%c IN (CALL DEL) DO %%c %temp%.\setdir.bat
rem #--- Part 2 for WinNTx (4.0/2000/XP)
if "%curdir%"=="" set curdir=%cd%
rem # Uncomment next 2 lines, to check
rem # value of curdir under WinNTx:
rem echo "CURDIR"="%curdir%"
rem pause
rem #--- Part 3: Use curdir
set libdir=%curdir%\..\lib\gcl-2.5.0
set unixportdir=%libdir%\unixport
path %curdir%\..\mingw\bin;%PATH%
set curdir=
Best wishes
Michel.Lavaud@univ-orleans.fr
http://www.univ-orleans.fr/EXT/ASTEXftp://ftp.univ-orleans.fr/pub/tex/PC/AsTeX
liste de discussion: astex@univ-orleans.fr
Abonnement à la liste: envoyer un message de contenu
"sub astex Nom Prenom Etablissement" à sympa@univ-orleans.fr