@echo off
if "%1"=="" (
  Echo CreateObject^("Shell.Application"^).ShellExecute WScript.Arguments^(0^),"test","","runas",1 >"%~dp0elev.vbs"
  cscript.exe //nologo "%~dp0elev.vbs" "%~dpnx0"& Goto :eof
)
>nul del "%~dp0elev.vbs"
chdir /d "%~dp0"

echo Installation...

REG ADD "HKLM\SOFTWARE\Aktiv Co.\Rutoken\rtPKCS11-Spy" /v Module /t REG_SZ /d "%SystemRoot%\system32\rtPKCS11ECP_orig.dll" /f > Nul
REG ADD "HKLM\SOFTWARE\Aktiv Co.\Rutoken\rtPKCS11-Spy" /v Output /t REG_SZ /d "%TEMP%\rtpkcs11-spy.log" /f > Nul

copy %SystemRoot%\system32\rtPKCS11ECP.dll %SystemRoot%\system32\rtPKCS11ECP_orig.dll
copy rtpkcs11-spy.dll %SystemRoot%\system32\rtPKCS11ECP.dll

echo Installation completed successfully.

Pause