@echo off
set plesk_python_path=%plesk_dir%python\python.exe
set plesk_migrator_backend_path=%plesk_dir%admin\plib\modules\panel-migrator\backend\plesk-migrator.py

for /f "skip=2 tokens=3*" %%i IN ('reg query "HKLM\SOFTWARE\Plesk\PSA Config\Config" /v PRODUCT_DATA_D /reg:32') do set plesk_data_path=%%i %%j
call :TRIM %plesk_data_path% plesk_data_path

set plesk_migrator_var_path=%plesk_data_path%var\modules\panel-migrator

set PLESK_EXTENSION_ID=panel-migrator

"%plesk_python_path%" "%plesk_migrator_backend_path%" "%plesk_migrator_var_path%" %*
goto :EOF

:TRIM
SET %2=%1
goto :EOF