@echo off

for /f "tokens=4 delims=. " %%i in ('ver') do set /a VERSION=%%i
if %VERSION% GTR 10 goto win11
for /f "tokens=5 delims=. " %%i in ('ver') do set /a VERSION=%%i
if %VERSION% GTR 0 goto win11
for /f "tokens=6 delims=. " %%i in ('ver') do set /a VERSION=%%i
if %VERSION% GEQ 20000 goto win11
goto legacy 

:legacy
reg add HKEY_CLASSES_ROOT\txtfile\shell\检测重复参考文献\command /ve /d "\"%~dp0py34\python.exe\" \"%~dp0src\main.py\" \"%%1\"" /f
goto eof

:win11
reg add HKEY_CLASSES_ROOT\*\shell\检测重复参考文献\command /ve /d "\"%~dp0py34\python.exe\" \"%~dp0src\main.py\" \"%%1\"" /f
goto eof