Two possibilities:
- Use wildcards to process all files in a directory:
FOR %%F in (D:\Karten\shp\Gemeinden\*.shp) DO ogr2ogr -t_srs EPSG:31466 D:\Karten\shp\neu\%%~nxF %%F
- Use quotation marks around path and filename:
ogr2ogr -t_srs EPSG:31466 "D:\Karten\shp\Test 1.shp" "D:\Karten\shp\Test 2.shp"
EDIT
This one works for me:
for /R %%F in (*.shp) do ogr2ogr -f "KML" "%%~dpnF.kml" "%%F"