@ECHO OFF
setlocal enabledelayedexpansion

set bindir=%1
set currentpath=%cd%
set bindir=%bindir:"=%

for /f %%i in ('wmic os get osarchitecture') do ( 
	set RESULT=%%i
	if "!RESULT!"=="64-bit" (
		echo  - Windows architecture is 64-bit
		echo  - Copying 64-bit openit_appusage.exe
		copy "!currentpath!\bin\openit_appusage_64.exe" "!bindir!\openit_appusage.exe"
	)
	if "!RESULT!"=="32-bit" (
		echo  - Windows architecture is 32-bit
		echo  - Copying 32-bit openit_appusage.exe
		copy "!currentpath!\bin\openit_appusage_32.exe" "!bindir!\openit_appusage.exe"
	)
)