@echo off setlocal EnableDelayedExpansion set "CurrCD=%~dp0" for /f %%i in ('dir sdk /b /s') do ( powershell -Command "& {$fileContent = Get-Content -Path %%i;$newContent = $fileContent -replace 'TCHAR', 'CHAR ';$newContent | Set-Content -Path %%i}" )