cmd.exe
, a part of a variable can be replaced with a different value with the %VARNAME:search=replace%
construct: @echo off setlocal rem rem Note the typo rem set VAR=Hello wrold. rem rem print the variable and fix the rem typo in one go: rem echo %VAR:wrold=world% endlocal