@echo off
IF "%1"=="" GOTO USAGE
IF NOT EXIST "%1" GOTO WRONG
IF "%2"=="" SET DESTDIR=%1ref
mkdir %DESTDIR%/AAA/BBB
copy %1/AAA/BBB/A.c %DESTDIR%/AAA/BBB
GOTO END
:USAGE
ECHO REF SRC_PATH DEST_PATH
ECHO REF SRC_PATH
GOTO END
:WRONG
ECHO Path not exist
GOTO END
:END
echo on