Page 1 of 1

using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 6:14 am
by AUGE_OHR
hi,

when using CMD-Box and BUILD.BAT it will include PATH for HMG

Code: Select all

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
this will be done every time i use it in CMD-Box ...

how to modify BUILD.BAT to SET PATH "once" ( check if already in PATH ) :idea:

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 8:27 am
by trmpluym
path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 11:27 am
by Anand
trmpluym wrote:
Sat May 16, 2020 8:27 am
path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%
Never knew about this trick.
We learn each day !

Regards,

Anand

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 12:03 pm
by dragancesu
Just add c:\hmg.3.4.4 in PATH

control panel'-> system -> advanced system setting -> environment variables

in section system in PATH add hmgpath

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 5:26 pm
by AUGE_OHR
hi,
dragancesu wrote:
Sat May 16, 2020 12:03 pm
Just add c:\hmg.3.4.4 in PATH
thx

Code: Select all

rundll32.exe sysdm.cpl,EditEnvironmentVariables
it is not "only" HMG ... need it also for Extended Version or FiveWin when using *.BAT in CMD-Box

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 5:32 pm
by AUGE_OHR
hi,
trmpluym wrote:
Sat May 16, 2020 8:27 am
path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%
it is long time ago that i work with *.BAT Syntax.
how to write it with GOTO

Code: Select all

@echo off
IF EXIST %1 GOTO ERRORRAUS
// do something here
goto OKRAUS

:ERRORRAUS
CLS
ECHO.
ECHO Das File %1 existiert schon !!!

:OKRAUS
i like to "skip" Section of SET PATH when exist

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 6:27 pm
by trmpluym
i like to "skip" Section of SET PATH when exist

Code: Select all

path|find /i "%HMGPATH%\harbour\bin" >nul || GOTO SETPATH

GOTO END

:SETPATH
set path=%HMGPATH%\harbour\bin;%path%

:END

Re: using BUILD.BAT in CMD-Box

Posted: Sat May 16, 2020 8:38 pm
by AUGE_OHR
trmpluym wrote:
Sat May 16, 2020 6:27 pm
i like to "skip" Section of SET PATH when exist

Code: Select all

path|find /i "%HMGPATH%\harbour\bin" >nul || GOTO SETPATH
GOTO END

:SETPATH
set path=%HMGPATH%\harbour\bin;%path%

:END
thats it, THX