 <pre><code>@echo off pushd c:\test_dir for /r %%a in (*) do ( java -Durl=http://localhost:8983/solr/update/extract?literal.id=%%~nxa -Dtype=application/word -jar post.jar "%%~dpfnxa" ) </code></pre> <p>This will process the files recursively.You can filter the files "wild-cards" expression -> <code>for /r %%a in (*doc)</code> or do it only for the current folder <code>for %%a in (*)</code> .</p>