@echo off
setlocal enabledelayedexpansion
for %%i in (*.exe) do (
  set f=%%i.config
  if exist !f! (
    echo 删除!f!
    del /F !f! 
  ) else (
    echo 不存在, 创建文件!f!
  )
  echo ^<?xml version="1.0" encoding="utf-8"?^> >> !f!
  echo ^<configuration^> >> !f!
  echo ^<startup^>^<supportedRuntime version="v2.0.50727"/^> >> !f!
  echo ^<supportedRuntime version="v4.0"/^>^</startup^>^</configuration^> >> !f!
)
echo End!
pause&exit