Este é o scritpt que uso para adicionar um novo vhost ao XAMPP
<?php
$result = 0;
if ($_POST['domain'] != '') {
$domain = $_POST['domain'];
$path_logs = 'c:/xampp/apache/logs';
$path_web = 'c:/xampp/htdocs/%domain%/web';
$file_vhosts = 'c:/xampp/apache/conf/extra/httpd-vhosts.conf';
$vhost_template = "
## %domain% -------------------------------------------------------
<VirtualHost %domain%:80>
DocumentRoot %path_web%
ServerName %domain%
ServerAlias www.%domain%
ErrorLog %path_logs%/%domain%.error.log
CustomLog %path_logs%/%domain%.access.log common
<Directory "%path_web%"">
Options Indexes Includes execCGI FollowSymLinks
AllowOverride All
Order Allow