@echo off
rem //------------------------------------------------------------------------------
rem // リモートマイクロ交換(Setup Installer) rmapiフォルダ一時退避登録バッチファイル
rem //------------------------------------------------------------------------------
cd /d %~dp0

rem 引数：インストールパス
set INSDIR=%1
set TARGETDIR=%INSDIR%\wk\supervisor\rmapi

for /f "usebackq tokens=1" %%i in (`dir %TARGETDIR%\*.dll /b`) do (
	move /Y %TARGETDIR%\%%i %TARGETDIR%\%%i.old > nul 2>&1
)
dir %TARGETDIR%\*.dll /b > nul 2>&1
rem リネーム実行後に元のファイルが存在する（リネーム失敗）？
if "%errorlevel%" neq "1" (
	rem 異常終了
	exit /b -1
)


rem 正常終了
exit /b 0
