Some time ago I needed to change an acronym inside a file on several different servers, so searching I found the solution below.
Utilizes the powershell to find the sequence and replace, I used your variable example and changed the code, in addition make a backup.
@echo off
@SET /P COD01=Cod_01
@SET /P COD02=Cod_02
@call:DoReplace %COD01% %COD02% arquivooriginal.txt arquivomodificado.txt
@exit /b
::Cria o arquivo do PowerShell para ser executado conforme parâmetros acima.
:DoReplace
@echo ^(Get-Content "%3"^) ^| ForEach-Object { $_ -replace %1, %2 } ^| Set-Content %4>Rep.ps1
::Executa o arquivo criado.
@Powershell.exe -executionpolicy ByPass -File Rep.ps1
::Deleta o arquivo.
@if exist Rep.ps1 del Rep.ps1
:: Renomeia.
@RENAME arquivooriginal.txt arquivooriginal_old.txt
@RENAME arquivomodificado.txt arquivooriginal.txt
Welcome to Stack Overflow, Maressa! Please edit your question and explain better what you are trying to do - how many files do you intend to modify? Is it just a line of text within each or more of them? Also include the code you’ve already made. And enjoy it and tour to get to know the site better! :)
– Daniel