View Single Post
Old 05-07-2014, 07:52 AM   #83
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
@Anak, thank you for your comment and the suggestion.

Actually, I modified my original script to the hard-coded version before posting, since I thought (maybe this was a mistake) this might prevent troubles with uncommon settings. In case it might be useful for somebody, my original script sets the the7zipexe this way:

Code:
REM --- get the path to 7zip.exe
cd "%~dp0"
for /f "delims=" %%i in ('_get_7zip.bat') do (SET the7zipexe=%%i)
IF "%the7zipexe%"=="no" (GOTO exenotfound)
And the _get_7zip.bat:
Code:
@ECHO OFF
REM ------- try to get a manually set 7-zip executable
SET theexe=C:\Program Files\7-Zip\7z.exe
IF EXIST "%theexe%" (GOTO foundit)

REM ------- try to get another manually set 7-zip executable
SET theexe=C:\7za920\7za.exe
IF EXIST "%theexe%" (GOTO foundit)

REM ------- repeat this for other non-standard locations on your machines

REM ------- try to get the installed 7-zip executable
FOR /f "tokens=2*" %%A in ('REG QUERY "HKEY_LOCAL_MACHINE\Software\7-Zip" /v Path') DO SET theexe=%%B\7z.exe
IF EXIST "%theexe%" (GOTO foundit)

SET theexe=no
:foundit
ECHO %theexe%

Last edited by tshering; 05-07-2014 at 08:00 AM.
tshering is offline   Reply With Quote