Files
RFB/replace.bat
2025-11-10 13:21:46 +03:00

41 lines
968 B
Batchfile

@echo off
setlocal
set "vmix_file=%~1"
if "%vmix_file%"=="" (
echo Usage: %0 filename.vmix
pause
exit /b 1
)
if not exist "%vmix_file%" (
echo File "%vmix_file%" not found!
pause
exit /b 1
)
set "replace=https://per.tvstart.ru"
set "temp_file=%vmix_file%.tmp"
echo Processing: %vmix_file%
powershell -Command "
$content = Get-Content '%vmix_file%' -Raw
$pattern = 'https?:\/\/\d*\.\d*\.\d*\.\d*:\d*|https?:\/\/\w*\.\w*\.\w*'
$replacement = '%replace%'
$result = $content -replace $pattern, $replacement
$result | Out-File '%temp_file%' -Encoding UTF8
"
if exist "%temp_file%" (
move /y "%temp_file%" "%vmix_file%" > nul
echo Replacement completed successfully!
echo URLs matching these patterns were replaced:
echo - IP addresses with ports (http://127.0.0.1:8000 etc.)
echo - Three-part domains (https://gfx.tvstart.ru etc.)
echo Replacement: %replace%
) else (
echo Error: Failed to process file
)
pause