@echo off set Release=5 %~d0 cd %~p0 if "%Release%@" == "4@" call :SetNavisionPath "Navision\Microsoft Business Solutions-Navision\W1 4.00" 2>NUL if "%Release%@" == "5@" call :SetNavisionPath "Microsoft\Dynamics NAV\CSIDE Client\W1 5.0 SP1" 2>NUL if "%Release%@" == "6@" call :SetNavisionPath "Microsoft\Microsoft Dynamics NAV\60\Classic Client\W1 6.0" 2>NUL goto :EOF :SetNavisionPath rem echo - Begin %0 ----------------------------------------------------------------------- set NavPath= REM 32-bits OS set RegEntry="HKLM\SOFTWARE\%~1" for /F "tokens=2*" %%A in ('reg query %RegEntry% /v Path') do if NOT @%%B == @ set NavPath=%%B if NOT "%NavPath%@"=="@" GOTO :Install REM 64-bits OS set RegEntry="HKLM\SOFTWARE\Wow6432Node\%~1" for /F "tokens=2*" %%A in ('reg query %RegEntry% /v Path') do if NOT @%%B == @ set NavPath=%%B if "%NavPath%@"=="@" GOTO :EOF :Install echo Release : %Release% echo Registry: %RegEntry% echo Path : %NavPath% echo. set _Navision="%NavPath%ACA" md %_Navision% echo Copy files to ACA folder xcopy ACA %_Navision% /S /I /F /Y if ERRORLEVEL 1 echo Files not copied to ACA folder echo. pushd %_Navision% echo Current : %CD% rem echo - End %0 ----------------------------------------------------------------------- echo. echo Now Register All pause call RegisterAll.cmd popd