sinais feios <>|&
devem ser ignorados em lote com um sinal de intercalação ^
, tente isto:
@echo off
(
echo ###%sitename%###
echo ^<VirtualHost *:80^>
echo ServerAdmin admin@%sitename%
echo DocumentRoot "%BASEURL%%sitename%"
echo ServerName %sitename%.dev
echo ServerAlias %sitename%.dev
echo ^<Directory "%BASEURL%%sitename%"^>
echo Options Indexes FollowSymLinks Includes ExecCGI
echo Order allow,deny
echo Allow from all
echo ^</Directory^>
echo ^</VirtualHost^>
) >>D:\web\xampp\apache\conf\extra\httpd-vhosts.conf