Ampersand seems to be splitting my variable - batch file
<p>I have the following code which works beautifully </p>

<pre><code>set "findest=\\CFFS\CF_Networked_Files\!!CLIENT DOCUMENTS\%PrimaryApplicantLast%, %PrimaryApplicantlFirst%"
.....
@echo %DATE% %time:~0,-6% [%findest%] &gt;&gt; log.txt
</code></pre>

<p>When I run the same commands, but with the %findest% being slightly longer and containing an &amp; symbol, it seems to split the %findest% variable at, or just after the &amp;. </p>

<p>Problem code - </p>

<pre><code>SET "findest=\\CFFS\CF_Networked_Files\!!CLIENT DOCUMENTS\%PrimaryApplicantLast%, %PrimaryApplicantlFirst% &amp; %SecondaryApplicantLast%, %SecondaryApplicantFirst%"
....
@echo %DATE% %time:~0,-6% [%findest%] &gt;&gt; log.txt
</code></pre>

<p>There is plenty more going on in my code, but it is the writing to my log file that throws up an error, the error being the %SecondaryApplicantLast% isn't a valid command, leaving me to believe that my code has been split.  </p>

<p>Error - </p>

<pre><code>Press any key to continue . . .
Wed 24/02/2016 13:21 [\\CFFS\CF_Networked_Files\!!CLIENT DOCUMENTS\EXAMPLE, test

'EXAMPLE2' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
</code></pre>

<p>Cheers</p>

<p>EDIT - </p>

<pre><code>@echo
setlocal enableDelayedExpansion
echo.


echo. Client Folder Creator! 
echo.
echo. Follow the instructions to create appropriate client folders. 
echo --------------------------------------------------------------------------------

:choice
Set /P c=".Are there multiple applicants[Y/N]?"


:Primary
echo.
echo "Primary Applicant" 
echo.
set /P "PrimaryApplicantlFirst=Enter First Name: "
set /P "PrimaryApplicantLast=Enter Last Name: "
echo.

call :toUpper PrimaryApplicantLast


if /I "%c%" EQU "N" goto :CreateFolders
if /I "%c%" EQU "Y" goto :Secondary


:Secondary
echo "Secondary Applicant" 
echo.
set /P "SecondaryApplicantFirst=Enter First Name: "
set /P "SecondaryApplicantLast=Enter Last Name: "
echo.

call :toUpper SecondaryApplicantLast


goto :CreateFoldersMulti


:CreateFoldersMulti
SET "findest=\\CFFS\CF_Networked_Files\!!CLIENT DOCUMENTS\%PrimaryApplicantLast%, %PrimaryApplicantlFirst% ^&amp; %SecondaryApplicantLast%, %SecondaryApplicantFirst%"
robocopy Z:\ProjectIT\BAT\test "%findest%" /e /NFL /NDL /NJH /NJS
SET blanknum=1
SET "finsubdest=-BLANK-%PrimaryApplicantLast% &amp; %SecondaryApplicantLast%."

IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 

robocopy Z:\ProjectIT\BAT\Construction "%findest%\%blanknum%%finsubdest%" /e /NFL /NDL /NJH /NJS


echo Folder has been created for "%PrimaryApplicantLast% &amp; %SecondaryApplicantLast%"
echo.
@echo "%findest%"
echo.


pause


@echo %DATE% %time:~0,-6% [%findest%] &gt;&gt; log.txt


%SystemRoot%\explorer.exe "%findest%"

pause

goto :eof


:CreateFolders
set "source=Z:\ProjectIT\BAT\test"
set "findest=\\CFFS\CF_Networked_Files\!!CLIENT DOCUMENTS\%PrimaryApplicantLast%, %PrimaryApplicantlFirst%"
robocopy "%source%" "%findest%" /e /NFL /NDL /NJH /NJS
SET blanknum=1
set finsubdest=-BLANK-%PrimaryApplicantLast%

IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 
IF EXIST "%findest%\%blanknum%%finsubdest%" ( 
    SET /A blanknum=blanknum+1     
) 

robocopy Z:\ProjectIT\BAT\Construction "%findest%\%blanknum%%finsubdest%" /e /NFL /NDL /NJH /NJS


echo Folder has been created for "%PrimaryApplicantLast%"
echo.
echo %findest%
echo.


pause


@echo %DATE% %time:~0,-6% [%findest%] &gt;&gt; log.txt



%SystemRoot%\explorer.exe "%findest%"

goto :eof
:---------------------------------------------------------------------


:toUpper str -- converts lowercase character to uppercase
if not defined %~1 EXIT /b
for %%a in ("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I"
            "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R"
            "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z" "ä=Ä"
            "ö=Ö" "ü=Ü") do (
    call set %~1=%%%~1:%%~a%%
)
EXIT /b
</code></pre>