:: BatchGotAdmin
 :-------------------------------------
 REM  --> Check for permissions
 >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
 if '%errorlevel%' NEQ '0' (
     echo Requesting administrative privileges...
     goto UACPrompt
 ) else ( goto gotAdmin )

:UACPrompt
     echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
     echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
     exit /B

:gotAdmin
     if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
     pushd "%CD%"
     CD /D "%~dp0"

REM Make the environment variables
setx /m VWGENICAM_CACHE_V2_4 "c:\GenICam_v2_4\cache"
setx /m VWGENICAM_CLPROTOCOL "c:\GenICam_v2_4\bin\Win64_x64\CLProtocol"
setx /m VWGENICAM_LOG_CONFIG_V2_4 "c:\GenICam_v2_4"
setx /m VWGENICAM_ROOT_V2_4 "c:\GenICam_v2_4"

REM Copy GenICam module
set CUR_PATH=%~dp0
xcopy "%CUR_PATH%\GenICam_v2_4\" "c:\GenICam_v2_4\" /e /h /k /y
