@echo off

if "%1"=="hide" goto CmdBegin
start mshta vbscript:createobject("wscript.shell").run("""%~0""hide",0)(window.close)&&exit

:CmdBegin
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%\getadmin.vbs"
echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%\getadmin.vbs"
echo WScript.Quit >>"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit

:Admin
if /i "%PROCESSOR_IDENTIFIER:~0,3%" == "x86" goto System32
if /i "%PROCESSOR_IDENTIFIER:~0,3%" NEQ "x86" goto System64
exit

:System32
ver|find "6.2." > NUL && goto Win8System32
ver|find "6.3." > NUL && goto Win8System32
ver|find "10.0." > NUL && goto Win8System32
VirtualComportDriver\VCP_V1.5.0_Setup_W7_x86_32bits.exe
exit

:System64
ver|find "6.2." > NUL && goto Win8System64
ver|find "6.3." > NUL && goto Win8System64
ver|find "10.0." > NUL && goto Win8System64
VirtualComportDriver\VCP_V1.5.0_Setup_W7_x64_64bits.exe
exit

:Win8System32
VirtualComportDriver\VCP_V1.5.0_Setup_W8_x86_32bits.exe
exit

:Win8System64
VirtualComportDriver\VCP_V1.5.0_Setup_W8_x64_64bits.exe
exit